X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=app%2FResources%2Fstatic%2Fthemes%2Fmaterial%2Fjs%2Fshortcuts%2Fentry.js;h=e19800bd3a175ef34c68e55510a3a3bff572eb42;hb=339b1e689d96b433d88ca1ad2325031841ae450d;hp=2dcc93d7d8d14bf04f87e62855790e8e7730ef24;hpb=c526f9e4744ac03aa7ab4ff507d5466eee371b08;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 2dcc93d7..e19800bd 100644 --- a/app/Resources/static/themes/material/js/shortcuts/entry.js +++ b/app/Resources/static/themes/material/js/shortcuts/entry.js @@ -1,22 +1,26 @@ import Mousetrap from 'mousetrap'; import $ from 'jquery'; -/* open original article */ -Mousetrap.bind('o', () => { - $('ul.side-nav a.original 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 favorite */ -Mousetrap.bind('f', () => { - $('ul.side-nav a.favorite 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(); -}); + /* mark as read */ + Mousetrap.bind('a', () => { + $('ul.side-nav a.markasread i')[0].click(); + }); -/* delete */ -Mousetrap.bind('del', () => { - $('ul.side-nav a.delete i')[0].click(); + /* delete */ + Mousetrap.bind('del', () => { + $('ul.side-nav a.delete i')[0].click(); + }); + } });