Merge pull request #563 from dmitrylyzo/focus_pageload

Add autofocus on page load
This commit is contained in:
dkanada 2019-11-28 23:35:51 +09:00 committed by GitHub
commit 59e9be84dd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 217 additions and 26 deletions

View file

@ -172,6 +172,10 @@ define(["loading", "events", "libraryBrowser", "imageLoader", "listView", "cardB
libraryBrowser.saveQueryValues(getSavedQueryKey(page), query);
loading.hide();
isLoading = false;
require(["autoFocuser"], function (autoFocuser) {
autoFocuser.autoFocus(page);
});
});
}

View file

@ -77,6 +77,10 @@ define(["loading", "layoutManager", "userSettings", "events", "libraryBrowser",
isLoading = false;
loading.hide();
require(["autoFocuser"], function (autoFocuser) {
autoFocuser.autoFocus(tabContent);
});
}
function getItemsHtml(items) {

View file

@ -36,6 +36,9 @@ define(["events", "layoutManager", "inputManager", "userSettings", "libraryMenu"
showYear: true,
centerText: true
});
// FIXME: Wait for all sections to load
autoFocus(page);
});
}
@ -76,6 +79,9 @@ define(["events", "layoutManager", "inputManager", "userSettings", "libraryMenu"
showYear: true,
centerText: true
});
// FIXME: Wait for all sections to load
autoFocus(page);
});
}
@ -147,6 +153,15 @@ define(["events", "layoutManager", "inputManager", "userSettings", "libraryMenu"
var recs = page.querySelector(".recommendations");
recs.innerHTML = html;
imageLoader.lazyChildren(recs);
// FIXME: Wait for all sections to load
autoFocus(page);
});
}
function autoFocus(page) {
require(["autoFocuser"], function (autoFocuser) {
autoFocuser.autoFocus(page);
});
}