diff --git a/lib/system/lib/system.js b/lib/system/lib/system.js index 3e4338f..bbaffe0 100644 --- a/lib/system/lib/system.js +++ b/lib/system/lib/system.js @@ -128,7 +128,7 @@ SYSTEM.prototype.handle_call_pages_page = function (html,entry,id,forced,cached, //update state this.state[entry['div']] = url; callback(); -} +}; SYSTEM.prototype.handle_call_pages_entry = function (entry,id,forced,cached, callback) { var url = entry['url']+(window.location.search.substr(1) ? '&'+window.location.search.substr(1) : '' ); //check loaded state of div - reload only if required @@ -139,12 +139,12 @@ SYSTEM.prototype.handle_call_pages_entry = function (entry,id,forced,cached, cal system.log_info('load page: '+id+entry['div']+' '+url+' - cached'); callback(); } -} +}; //internal function to handle pagestate results SYSTEM.prototype.handle_call_pages = function (data,id,forced,cached) { var hash = null; - if (id.indexOf('#') != -1) { + if (id.indexOf('#') !== -1) { var splinters = id.split('#'); hash = splinters.pop() id = splinters.pop();} @@ -164,7 +164,7 @@ SYSTEM.prototype.handle_call_pages = function (data,id,forced,cached) { //update history? if( !(id === this.start_state && this.cur_state() === '') && //avoid start state in url unless called explicit id !== this.cur_state()){//new state? - window.history.pushState(null, "", '#!'+id+(hash ? '#'+hash : null));} + window.history.pushState(null, "", '#!'+id+(hash ? '#'+hash : ''));} //Syncronous Call to system.handle_call_pages_entry and done-function var done = function(){ diff --git a/sai/page/js/sai.js b/sai/page/js/sai.js index a73beda..f3cc363 100644 --- a/sai/page/js/sai.js +++ b/sai/page/js/sai.js @@ -9,12 +9,11 @@ $(document).ready(function() { }); function sys_hashchange(state){ - console.log(state); - state = state ? state.split(';')[0].split('(')[0] : state; + var state_ = state ? state.split(';')[0].split('(')[0] : state; $('.nav li,#sai_navbar li, #project_navbar li').each(function(){ $(this).removeClass('active');}); - if($('#menu_'+state).parent().length){ - $('#menu_'+state).parent().addClass('active'); + if($('#menu_'+state_).parent().length){ + $('#menu_'+state_).parent().addClass('active'); } else { $('#menu_start').parent().addClass('active');} }