mirror of
https://github.com/rr-/szurubooru.git
synced 2025-07-17 08:26:24 +00:00
Added keyboard shortcuts to top navigation
This commit is contained in:
@ -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) {
|
||||
|
@ -47,6 +47,13 @@ App.Presenters.TopNavigationPresenter = function(
|
||||
$el.find('li.' + selectedElement).find('a').addClass('active');
|
||||
}
|
||||
|
||||
function focus() {
|
||||
var $tmp = jQuery('<a href="#"> </a>');
|
||||
$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,
|
||||
};
|
||||
|
Reference in New Issue
Block a user