mirror of
https://github.com/pierre42100/ComunicWeb
synced 2024-11-22 20:19:21 +00:00
Split menubar elements in multiple parts
This commit is contained in:
parent
2e85aa9c21
commit
3020abc4bf
@ -318,9 +318,22 @@ var ComunicWeb = {
|
||||
* Menubar
|
||||
*/
|
||||
menuBar: {
|
||||
|
||||
/**
|
||||
* Menu bar object - common methods
|
||||
*/
|
||||
common:{
|
||||
//TODO : implement
|
||||
},
|
||||
|
||||
/**
|
||||
* Not authenticated menu bar components
|
||||
*/
|
||||
notAuthenticated: {
|
||||
//TODO : implement
|
||||
}
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -172,7 +172,7 @@ ComunicWeb.common.page = {
|
||||
document.body.className="hold-transition skin-blue layout-top-nav";
|
||||
|
||||
//We load the menubar
|
||||
ComunicWeb.components.menuBar.display();
|
||||
ComunicWeb.components.menuBar.common.display();
|
||||
}
|
||||
|
||||
//Check if some additionnal data was specified
|
||||
|
@ -1,10 +1,10 @@
|
||||
/**
|
||||
* Menu bar object
|
||||
* Menu bar object - common methods
|
||||
*
|
||||
* @author Pierre HUBERT
|
||||
*/
|
||||
|
||||
ComunicWeb.components.menuBar = {
|
||||
ComunicWeb.components.menuBar.common = {
|
||||
/**
|
||||
* Display menu bar
|
||||
*
|
||||
@ -71,6 +71,15 @@ ComunicWeb.components.menuBar = {
|
||||
});
|
||||
|
||||
//Now we need to know if user is logged in or not
|
||||
var userLoggedIn = ComunicWeb.user.userLogin.getUserLoginState();
|
||||
|
||||
//Call specific menu
|
||||
if(userLoggedIn){
|
||||
//Not implemented yet
|
||||
}
|
||||
else{
|
||||
//Call not-logged-in menu
|
||||
ComunicWeb.components.menuBar.notAuthenticated.addElements(containerElem);
|
||||
}
|
||||
},
|
||||
};
|
16
assets/js/components/menuBar/notAuthenticated.js
Normal file
16
assets/js/components/menuBar/notAuthenticated.js
Normal file
@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Not authenticated menu bar components
|
||||
*
|
||||
* @author Pierre HUBERT
|
||||
*/
|
||||
|
||||
ComunicWeb.components.menuBar.notAuthenticated = {
|
||||
/**
|
||||
* Add not-authenticated user specific elements
|
||||
*
|
||||
* @param {HTMLElement} addElements The container element of the Menubar
|
||||
*/
|
||||
addElements: function(addElements){
|
||||
|
||||
}
|
||||
}
|
@ -18,7 +18,7 @@ ComunicWeb.pages.home.landingPage = {
|
||||
|
||||
//Preparing next actions
|
||||
var afterParsingTemplate = function(){
|
||||
console.log(byId("homeLandingScreen"));
|
||||
|
||||
//Change home background
|
||||
byId("homeLandingScreen").style.backgroundImage = "url('"+ComunicWeb.__config.assetsURL + "img/pages/home/landingPage/img_background.jpg')";
|
||||
};
|
||||
|
@ -53,7 +53,8 @@ $config['JSfiles'] = array(
|
||||
"%PATH_ASSETS%js/common/system.js",
|
||||
|
||||
//Components
|
||||
"%PATH_ASSETS%js/components/menuBar.js",
|
||||
"%PATH_ASSETS%js/components/menuBar/common.js",
|
||||
"%PATH_ASSETS%js/components/menuBar/notAuthenticated.js",
|
||||
|
||||
//User scripts
|
||||
"%PATH_ASSETS%js/user/loginTokens.js",
|
||||
|
Loading…
Reference in New Issue
Block a user