diff --git a/TODO b/TODO index 5888fa93..1d1fd752 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 - - add hotkeys for focusing items in top navigation - add customizable favicon - add customizable logo - add log engine and log everything that should be logged diff --git a/public_html/js/PresenterManager.js b/public_html/js/PresenterManager.js index 20a0b94d..9aad5578 100644 --- a/public_html/js/PresenterManager.js +++ b/public_html/js/PresenterManager.js @@ -36,6 +36,7 @@ App.PresenterManager = function(jQuery, topNavigationPresenter, keyboard) { if (lastContentPresenter === null || lastContentPresenter.name !== presenter.name) { keyboard.reset(); topNavigationPresenter.changeTitle(null); + topNavigationPresenter.focus(); presenter.init.call(presenter, args, contentPresenterLoaded); lastContentPresenter = presenter; } else if (lastContentPresenter.reinit) { diff --git a/public_html/js/Presenters/TopNavigationPresenter.js b/public_html/js/Presenters/TopNavigationPresenter.js index 5b99f970..5b70ce70 100644 --- a/public_html/js/Presenters/TopNavigationPresenter.js +++ b/public_html/js/Presenters/TopNavigationPresenter.js @@ -47,6 +47,13 @@ App.Presenters.TopNavigationPresenter = function( $el.find('li.' + selectedElement).find('a').addClass('active'); } + function focus() { + var $tmp = jQuery(' '); + $el.prepend($tmp); + $tmp.focus(); + $tmp.remove(); + } + function getBaseTitle() { return baseTitle; } @@ -63,6 +70,7 @@ App.Presenters.TopNavigationPresenter = function( init: init, render: render, select: select, + focus: focus, getBaseTitle: getBaseTitle, changeTitle: changeTitle, }; diff --git a/public_html/templates/top-navigation.tpl b/public_html/templates/top-navigation.tpl index b0173174..dc9daef4 100644 --- a/public_html/templates/top-navigation.tpl +++ b/public_html/templates/top-navigation.tpl @@ -1,35 +1,94 @@