From 00e8c983419c2b39f7e09f1d861dad57ea0cc1b7 Mon Sep 17 00:00:00 2001 From: rylon Date: Fri, 10 Apr 2015 19:58:47 +0200 Subject: [PATCH] small fixes with timing in system.js --- files/sys/system.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/files/sys/system.js b/files/sys/system.js index 20c3803..6d02b5b 100644 --- a/files/sys/system.js +++ b/files/sys/system.js @@ -91,7 +91,7 @@ SYSTEM.prototype.handle_call_pages_page = function (html,entry,id,forced,cached) SYSTEM.prototype.handle_call_pages_entry = function (entry,id,forced,cached) { var url = entry['url']+(window.location.search.substr(1) ? '&'+window.location.search.substr(1) : '' ); //check loaded state of div - reload only if required - if(forced || this.state[entry['div']] !== url || !$(entry['div']).length){ + if(forced || this.state[entry['div']] !== url || !$(entry['div']).length || $(entry['div']).html() === ''){ //load page this.call_url(url,function(data){system.handle_call_pages_page(data,entry,id,forced,cached);},{},'html',true); } else { @@ -100,11 +100,7 @@ SYSTEM.prototype.handle_call_pages_entry = function (entry,id,forced,cached) { } //internal function to handle pagestate results SYSTEM.prototype.handle_call_pages = function (data,id,forced,cached) { - if(data['status']){ - //clear old state - //this.state = {} - this.state_info = {} - + if(data['status']){ this.log_info('load pages: endpoint '+this.endpoint+' group:'+this.group+' state:'+id+' - '+(cached ? 'cached ' : (forced ? 'forced' : 'success'))); //state not found? if(data['result'].length === 0){