UX: Disable back button in full-screen viewers and editors

Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
Michael Mayer 2020-12-27 13:29:36 +01:00
parent 13bd176f0f
commit 9be5f332d2
2 changed files with 8 additions and 2 deletions

View file

@ -109,7 +109,10 @@ const router = new Router({
}); });
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
if (to.matched.some((record) => record.meta.settings) && config.values.disable.settings) { if (document.documentElement.className) {
// Disable back button in full-screen viewers and editors.
next(false);
} else if (to.matched.some((record) => record.meta.settings) && config.values.disable.settings) {
next({ name: "home" }); next({ name: "home" });
} else if (to.matched.some((record) => record.meta.admin)) { } else if (to.matched.some((record) => record.meta.admin)) {
if (isPublic || session.isAdmin()) { if (isPublic || session.isAdmin()) {

View file

@ -109,7 +109,10 @@ const router = new Router({
}); });
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
if (to.matched.some((record) => record.meta.settings) && config.values.disable.settings) { if (document.documentElement.className) {
// Disable back button in full-screen viewers and editors.
next(false);
} else if (to.matched.some((record) => record.meta.settings) && config.values.disable.settings) {
next({ name: "home" }); next({ name: "home" });
} else if (to.matched.some((record) => record.meta.admin)) { } else if (to.matched.some((record) => record.meta.admin)) {
if (isPublic || session.isAdmin()) { if (isPublic || session.isAdmin()) {