From c648cd848d1961c9a90760c2a83bdc9a23986b38 Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski <mkurczew@gmail.com> Date: Fri, 25 Oct 2013 15:47:42 +0200 Subject: [PATCH] Fixed hotkeys bug --- public_html/media/js/post-view.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public_html/media/js/post-view.js b/public_html/media/js/post-view.js index 6a5f613d..c33b13f3 100644 --- a/public_html/media/js/post-view.js +++ b/public_html/media/js/post-view.js @@ -121,7 +121,7 @@ $(function() $.ajax(ajaxData); }); - Mousetrap.bind('a', function() { window.location = $('#sidebar .left a').attr('href'); }); - Mousetrap.bind('d', function() { window.location = $('#sidebar .right a').attr('href'); }); + Mousetrap.bind('a', function() { var url = $('#sidebar .left a').attr('href'); if (typeof url !== 'undefined') window.location.href = url; }); + Mousetrap.bind('d', function() { var url = $('#sidebar .right a').attr('href'); if (typeof url !== 'undefined') window.location.href = url; }); Mousetrap.bind('e', function() { $('li.edit a').trigger('click'); return false; }); });