From b2ccb4fcbf8db85201cf0664c7e42b02dd9c1221 Mon Sep 17 00:00:00 2001 From: gine Date: Sat, 8 Apr 2017 16:27:02 +0200 Subject: [PATCH] Rimossi eventi ripetibili per implementarli in una pagina separata --- www/js/crud.events.js | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/www/js/crud.events.js b/www/js/crud.events.js index 75d1f90..7490dfd 100644 --- a/www/js/crud.events.js +++ b/www/js/crud.events.js @@ -25,24 +25,14 @@ EVENTS.formatDate = function(date, format) { return mdate.isValid() ? mdate.format(format) : ""; }; -EVENTS.eventsLoaded = 0; - EVENTS.render = function() { - EVENTS.eventsLoaded = 0; - -// //Se si lancia il loader prima che sia cambiata pagina il loader scompare, -// // ritardando invece che appaia, quando appare è già sulla pagina in cambiata -// setTimeout(function () { -// $.mobile.loading('show'); -// }, 300); - var ret = checkConnection('ERR_EVENT'); if (ret) { EVENTS.getDataAndLoad(ai1ec.cats.single); - EVENTS.getDataAndLoad(ai1ec.cats.repeat); + //EVENTS.getDataAndLoad(ai1ec.cats.repeat); } else { EVENTS.loadFromDb('#mostralista-'+ ai1ec.cats.single, ai1ec.cats.single); - EVENTS.loadFromDb('#mostralista-'+ ai1ec.cats.repeat, ai1ec.cats.repeat); + //EVENTS.loadFromDb('#mostralista-'+ ai1ec.cats.repeat, ai1ec.cats.repeat); } }; @@ -103,13 +93,10 @@ EVENTS.getDataAndLoad = function (type) { }; EVENTS.hideLoader = function(){ - if(EVENTS.eventsLoaded >= Object.keys(EVENTS.table).length) - $.mobile.loading('hide'); + $.mobile.loading('hide'); }; EVENTS.errorHandler = function(msg, type) { - EVENTS.eventsLoaded++; - if(type === 'info') { toastr.info(msg); } else { @@ -147,13 +134,13 @@ EVENTS.loadFromDb = function (containerId, type) { items.push(li); } - EVENTS.eventsLoaded++; + $(containerId).empty(); $("