diff --git a/module/index/js/index.js b/module/index/js/index.js index ae7b0e4c30..cb3a9d0084 100644 --- a/module/index/js/index.js +++ b/module/index/js/index.js @@ -178,18 +178,6 @@ } } - /* Set openApp cookie */ - $.cookie('openApp', appCode, {expires: config.cookieLife, path: config.webRoot}); - - /* Highlight at main menu */ - var $menuMainNav = $('#menuMainNav,#menuMoreNav'); - var $lastActiveNav = $menuMainNav.find('li.active'); - if($lastActiveNav.data('app') !== appCode) - { - $lastActiveNav.removeClass('active'); - $menuMainNav.find('li[data-app="' + appCode + '"]').addClass('active'); - } - /* Create pate app object and store it */ var app = openedApps[appCode]; if(app) @@ -230,6 +218,18 @@ if(!url) url = appsMap[appCode].url; } + /* Set openApp cookie */ + $.cookie('openApp', appCode, {expires: config.cookieLife, path: config.webRoot}); + + /* Highlight at main menu */ + var $menuMainNav = $('#menuMainNav,#menuMoreNav'); + var $lastActiveNav = $menuMainNav.find('li.active'); + if($lastActiveNav.data('app') !== appCode) + { + $lastActiveNav.removeClass('active'); + $menuMainNav.find('li[data-app="' + appCode + '"]').addClass('active'); + } + /* Show page app and update iframe source */ if(url) reloadApp(appCode, url); app.zIndex = openedAppZIndex++;