diff --git a/files/sys/system.js b/files/sys/system.js index b2a1672..183ad84 100644 --- a/files/sys/system.js +++ b/files/sys/system.js @@ -47,21 +47,23 @@ SYSTEM.prototype.handle_call_pages_page = function (html,entry,id,forced,cached) $.getScript(entry['js'][i]) .done(function(response, status, jqxhr) { system.log_info('load js: '+status); + system.state_js[entry['js'][i]] = true; if(loaded++ === entry['js'].length-1){ var fn = window[entry['func']]; - if(call_func && typeof fn === 'function'){ - call_func = false; - fn(); - system.log_info('call func: '+entry['func']); - } else { - system.log_error('call func: '+entry['func']+' - fail'); + if(call_func ){ + if(typeof fn === 'function'){ + call_func = false; + fn(); + system.log_info('call func: '+entry['func']); + } else { + system.log_error('call func: '+entry['func']+' - fail'); + } } } }) .fail(function( jqxhr, settings, exception ) { system.log_error( "Something went wrong"+exception ); }); - this.state_js[entry['js'][i]] = true; } else { this.log_info('load js: '+entry['js'][i]+' - cached'); if(loaded++ === entry['js'].length-1){ diff --git a/sai/modules/saimod_sys_log/tpl/saimod_sys_log.tpl b/sai/modules/saimod_sys_log/tpl/saimod_sys_log.tpl index 9fc571c..d30a8e6 100644 --- a/sai/modules/saimod_sys_log/tpl/saimod_sys_log.tpl +++ b/sai/modules/saimod_sys_log/tpl/saimod_sys_log.tpl @@ -5,7 +5,7 @@
| Message |