Do not show applications with noNavbar properties on mobile theme applications list

This commit is contained in:
Hadi Nategh 2015-03-16 11:54:31 +00:00
parent 446ec78c13
commit 064af42728

View File

@ -178,7 +178,7 @@
{ {
$appHeader.addClass('egw_fw_mobile_popup_appHeader'); $appHeader.addClass('egw_fw_mobile_popup_appHeader');
// Add close button only after everything is loaded // Add close button only after everything is loaded
setTimeout(function(){$appHeader.prepend($closeBtn)},0); setTimeout(function(){$appHeader.prepend($closeBtn);},0);
} }
} }
@ -316,7 +316,7 @@
this.sideboxSizeCallback(_sideboxStartSize); this.sideboxSizeCallback(_sideboxStartSize);
// Check if user runs the app in full screen or not, then prompt user base on the mode // Check if user runs the app in full screen or not, then prompt user base on the mode
var fullScreen = this.isNotFullScreen() var fullScreen = this.isNotFullScreen();
if (fullScreen) egw.message(fullScreen,'info'); if (fullScreen) egw.message(fullScreen,'info');
}, },
@ -500,14 +500,33 @@
}, },
/** /**
* Load applications
* *
* @param {object} _apps object list of applications
* @returns {undefined} * @returns {undefined}
*/ */
loadApplications: function () loadApplications: function (_apps)
{ {
var restore = this._super.apply(this, arguments); var restore = this._super.apply(this, arguments);
var activeApp = ''; var activeApp = '';
/**
* Check if the given app is in the navbar or not
*
* @param {string} appName application name
* @returns {Boolean} returns true if it is in the navbar, otherwise false
*/
var app_navbar_lookup = function (appName)
{
for(var i=0; i< _apps.length; i++)
{
// Do not show applications which are not suppose to be shown on nabvar, except home
if ((appName == _apps[i].name && !_apps[i]['noNavbar']) ||
(appName == _apps[i].name && _apps[i]['name'] == 'home')) return true;
}
return false;
};
//Now actually restore the tabs by passing the application, the url, whether //Now actually restore the tabs by passing the application, the url, whether
//this is an legacyApp (null triggers the application default), whether the //this is an legacyApp (null triggers the application default), whether the
//application is hidden (only the active tab is shown) and its position //application is hidden (only the active tab is shown) and its position
@ -525,8 +544,8 @@
{ {
activeApp = app; activeApp = app;
} }
this.applicationTabNavigate(restore[app].app, restore[app].url, app == activeApp?false:true, // Do not load the apps which are not in the navbar
-1); if (app_navbar_lookup(app)) this.applicationTabNavigate(restore[app].app, restore[app].url, app == activeApp?false:true,-1);
} }
//Set the current state of the tabs and activate TabChangeNotification. //Set the current state of the tabs and activate TabChangeNotification.
this.serializedTabState = egw.jsonEncode(this.assembleTabList()); this.serializedTabState = egw.jsonEncode(this.assembleTabList());
@ -580,7 +599,7 @@
{ {
var size= _size || this.sideboxSize; var size= _size || this.sideboxSize;
this.sideboxSizeCallback(size); this.sideboxSizeCallback(size);
this.appData.browser.callResizeHandler(); this.activeApp.browser.callResizeHandler();
}, },
/** /**
@ -805,7 +824,7 @@
{ {
return 'android'; return 'android';
} }
return 'unknown' return 'unknown';
}, },
/** /**