From bddf04ea78ce849cb5ddaa5d980835ea3500f95c Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Sat, 26 Oct 2013 12:39:15 +0200 Subject: [PATCH] Hotkeys should no longer get in the way --- public_html/media/js/core.js | 6 +++--- public_html/media/js/post-view.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/public_html/media/js/core.js b/public_html/media/js/core.js index 4e704346..4ba947c9 100644 --- a/public_html/media/js/core.js +++ b/public_html/media/js/core.js @@ -207,9 +207,9 @@ function getTagItOptions() $(function() { - Mousetrap.bind('q', function() { $('#top-nav input').focus(); return false; }); + Mousetrap.bind('q', function() { $('#top-nav input').focus(); return false; }, 'keyup'); Mousetrap.bind('w', function() { $('body,html').animate({scrollTop: '-=150px'}, 200); }); Mousetrap.bind('s', function() { $('body,html').animate({scrollTop: '+=150px'}, 200); }); - Mousetrap.bind('a', function() { var url = $('.paginator .prev:not(.disabled) a').attr('href'); if (typeof url !== 'undefined') window.location.href = url; }); - Mousetrap.bind('d', function() { var url = $('.paginator .next:not(.disabled) a').attr('href'); if (typeof url !== 'undefined') window.location.href = url; }); + Mousetrap.bind('a', function() { var url = $('.paginator .prev:not(.disabled) a').attr('href'); if (typeof url !== 'undefined') window.location.href = url; }, 'keyup'); + Mousetrap.bind('d', function() { var url = $('.paginator .next:not(.disabled) a').attr('href'); if (typeof url !== 'undefined') window.location.href = url; }, 'keyup'); }); diff --git a/public_html/media/js/post-view.js b/public_html/media/js/post-view.js index c33b13f3..b650fc03 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() { 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; }); + Mousetrap.bind('a', function() { var url = $('#sidebar .left a').attr('href'); if (typeof url !== 'undefined') window.location.href = url; }, 'keyup'); + Mousetrap.bind('d', function() { var url = $('#sidebar .right a').attr('href'); if (typeof url !== 'undefined') window.location.href = url; }, 'keyup'); + Mousetrap.bind('e', function() { $('li.edit a').trigger('click'); return false; }, 'keyup'); });