jellyfin-web/dashboard-ui/cordova/back.js
Luke Pulverenti 55e40bdcf7 vulcanize
2015-06-20 00:48:45 -04:00

24 lines
488 B
JavaScript

(function () {
Dashboard.exit = function () {
if (navigator.app && navigator.app.exitApp) {
navigator.app.exitApp();
} else {
Dashboard.logout();
}
};
function onBackKeyDown(e) {
if (Dashboard.exitOnBack()) {
e.preventDefault();
Dashboard.exit();
}
else {
history.back();
}
}
document.addEventListener("backbutton", onBackKeyDown, false);
})();