Код: Выделить всё
var app = new Framework7({
id: 'io.framework7.testapp',
el: '#app',
cache: false, /* disable caching */
theme: theme,
pushState : true,
routes: routes,
popup: {
closeOnEscape: true,
},
sheet: {
closeOnEscape: true,
},
popover: {
closeOnEscape: true,
},
actions: {
closeOnEscape: true,
},
vi: {
placementId: 'pltd4o7ibb9rc653x14',
},
methods:
{
onBackKeyDown: function()
{
if (app.views.main.router.url == '/') {
app.dialog.confirm('Are you sure you want to exit?', 'Exit app', function() {
navigator.app.exitApp();
},
function() {
});
} else {
mainView.router.back();
}
}
}
});
document.addEventListener('deviceready', onDeviceReady, false);
function onDeviceReady() {
document.addEventListener("backbutton", app.methods.onBackKeyDown, false);
}
Подробнее здесь: https://stackoverflow.com/questions/793 ... ework7-app