diff --git a/TODO b/TODO index 0139b0de..32d3df28 100644 --- a/TODO +++ b/TODO @@ -109,7 +109,6 @@ refactors: miscellaneous: - use 1 token for logins, so that session isn't killed - endless pager should include information about page number - - fix mouse trap hotkeys when leaving page - add hotkeys for focusing items in top navigation - add ability to select tags text in tag input - pasting tags should "soft-add" latest word in clipboard to input diff --git a/public_html/js/Keyboard.js b/public_html/js/Keyboard.js index 7581dcbc..11fef3d8 100644 --- a/public_html/js/Keyboard.js +++ b/public_html/js/Keyboard.js @@ -18,9 +18,14 @@ App.Keyboard = function(mousetrap) { }; } + function reset() { + mousetrap.reset(); + } + return { keydown: keydown, keyup: keyup, + reset: reset, }; }; diff --git a/public_html/js/PresenterManager.js b/public_html/js/PresenterManager.js index f1861820..20a0b94d 100644 --- a/public_html/js/PresenterManager.js +++ b/public_html/js/PresenterManager.js @@ -1,6 +1,6 @@ var App = App || {}; -App.PresenterManager = function(jQuery, topNavigationPresenter) { +App.PresenterManager = function(jQuery, topNavigationPresenter, keyboard) { var lastContentPresenter = null; var $spinner; @@ -34,6 +34,7 @@ App.PresenterManager = function(jQuery, topNavigationPresenter) { }, 100); if (lastContentPresenter === null || lastContentPresenter.name !== presenter.name) { + keyboard.reset(); topNavigationPresenter.changeTitle(null); presenter.init.call(presenter, args, contentPresenterLoaded); lastContentPresenter = presenter; @@ -67,4 +68,4 @@ App.PresenterManager = function(jQuery, topNavigationPresenter) { }; -App.DI.registerSingleton('presenterManager', ['jQuery', 'topNavigationPresenter'], App.PresenterManager); +App.DI.registerSingleton('presenterManager', ['jQuery', 'topNavigationPresenter', 'keyboard'], App.PresenterManager);