X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=app%2FResources%2Fstatic%2Fthemes%2Fmaterial%2Fjs%2Fshortcuts%2Fentry.js;h=e19800bd3a175ef34c68e55510a3a3bff572eb42;hb=d83d25dadec2c38460a32d96f5d2903426fec9d3;hp=900a8214f99694f2363fc622e0bfd60cac92c437;hpb=16ef7607f43ebc3e0134360b7657af191e14fe12;p=github%2Fwallabag%2Fwallabag.git diff --git a/app/Resources/static/themes/material/js/shortcuts/entry.js b/app/Resources/static/themes/material/js/shortcuts/entry.js index 900a8214..e19800bd 100644 --- a/app/Resources/static/themes/material/js/shortcuts/entry.js +++ b/app/Resources/static/themes/material/js/shortcuts/entry.js @@ -1,19 +1,26 @@ -/* open original article */ -Mousetrap.bind('o', () => { - $('ul.side-nav li:nth-child(2) a i')[0].click(); -}); +import Mousetrap from 'mousetrap'; +import $ from 'jquery'; -/* mark as favorite */ -Mousetrap.bind('s', () => { - $('ul.side-nav li:nth-child(5) a i')[0].click(); -}); +$(document).ready(() => { + if ($('#article').length > 0) { + /* open original article */ + Mousetrap.bind('o', () => { + $('ul.side-nav a.original i')[0].click(); + }); -/* mark as read */ -Mousetrap.bind('a', () => { - $('ul.side-nav li:nth-child(4) a i')[0].click(); -}); + /* mark as favorite */ + Mousetrap.bind('f', () => { + $('ul.side-nav a.favorite i')[0].click(); + }); + + /* mark as read */ + Mousetrap.bind('a', () => { + $('ul.side-nav a.markasread i')[0].click(); + }); -/* delete */ -Mousetrap.bind('del', () => { - $('ul.side-nav li:nth-child(6) a i')[0].click(); + /* delete */ + Mousetrap.bind('del', () => { + $('ul.side-nav a.delete i')[0].click(); + }); + } });