Merge pull request #720 from dmitrylyzo/exit_on_back

Add app exit on "Go back"
This commit is contained in:
dkanada 2020-01-31 01:05:15 +09:00 committed by GitHub
commit 1a3037229d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 67 additions and 14 deletions

View file

@ -1,4 +1,4 @@
define(['playbackManager', 'focusManager', 'appRouter', 'dom'], function (playbackManager, focusManager, appRouter, dom) {
define(['playbackManager', 'focusManager', 'appRouter', 'dom', 'apphost'], function (playbackManager, focusManager, appRouter, dom, appHost) {
'use strict';
var lastInputTime = new Date().getTime();
@ -96,7 +96,11 @@ define(['playbackManager', 'focusManager', 'appRouter', 'dom'], function (playba
appRouter.showSettings();
break;
case 'back':
appRouter.back();
if (appRouter.canGoBack()) {
appRouter.back();
} else if (appHost.supports('exit')) {
appHost.exit();
}
break;
case 'forward':
break;

View file

@ -226,7 +226,8 @@ define([
autoFocus: false,
anonymous: true,
startup: true,
controller: "auth/login"
controller: "auth/login",
type: "login"
});
defineRoute({
path: "/metadataimages.html",
@ -312,7 +313,8 @@ define([
autoFocus: false,
anonymous: true,
startup: true,
controller: "auth/selectserver"
controller: "auth/selectserver",
type: "selectserver"
});
defineRoute({
path: "/serveractivity.html",