From 86c0a9bfc7d69f6c82ac9e967f1083a1fb451a52 Mon Sep 17 00:00:00 2001 From: "cek@posta.indivia.net" Date: Thu, 30 Mar 2017 00:11:55 +0200 Subject: [PATCH] sistemato loader un'altra volta --- www/js/main.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/www/js/main.js b/www/js/main.js index c96c517..b4ce1b8 100644 --- a/www/js/main.js +++ b/www/js/main.js @@ -39,6 +39,8 @@ FONTE.hrefseguente = ""; FONTE.contentListId = '#mostralistainfo'; FONTE.contentListClass = '.news'; FONTE.ajaxError = false; + +FONTE.back_pressed = false; /* * data ultimo aggiornamento */ @@ -160,9 +162,20 @@ function initMainPage() { document.addEventListener("deviceready", onDeviceReady, false); //le cose all'inizio + +$(window).on("navigate", function (event, data) { + var direction = data.state.direction; + if (direction == 'back') { + FONTE.back_pressed = true; + } + else { + FONTE.back_pressed = false; + } +}); + $(document).on("pagecontainershow", function (e, ui) { var pageId = $('body').pagecontainer('getActivePage').prop('id'); - if (pageId != 'about') { + if ((pageId == 'ilove' || pageId == 'info' || pageId == 'events') && !FONTE.back_pressed) { $.mobile.loading('show'); } });