Menubar ready to be created

This commit is contained in:
Pierre 2017-05-21 17:55:19 +02:00
parent 7b6163328a
commit 6e50fa0894
4 changed files with 60 additions and 4 deletions

View File

@ -301,10 +301,17 @@ var ComunicWeb = {
}, },
/** /**
* Pages functions * Pages controllers
*/ */
pages:{ pages:{
/**
* Menubar
*/
menuBar: {
//TODO: implement
},
/** /**
* Home page * Home page
*/ */

View File

@ -153,13 +153,13 @@ ComunicWeb.common.page = {
} }
//Set wrapper class //Set wrapper class
mainContenerElem.className = "content-wrapper"; pageTarget.className = "content-wrapper";
//Set body class //Set body class
document.body.className="hold-transition skin-blue layout-top-nav"; document.body.className="hold-transition skin-blue layout-top-nav";
//We load the menu //We load the menubar
ComunicWeb.pages.menuBar.display();
} }
//Check if some additionnal data was specified //Check if some additionnal data was specified

View File

@ -0,0 +1,48 @@
/**
* Menu bar object
*
* @author Pierre HUBERT
*/
ComunicWeb.pages.menuBar = {
/**
* Display menu bar
*
* @return {Boolean} True for a success
*/
display: function(){
//Log message
ComunicWeb.debug.logMessage("Display menu bar");
//Try to get menubar element
var menuBar = byId("menuBar");
//We check if the menubar is present or not on the page
if(menuBar){
ComunicWeb.debug.logMessage("Info: The menubar is already present on the page");
return true;
}
//So we have to initializate it
//Create menubar element
var menuBar = createElem("div");
byId("wrapper").insertBefore(menuBar, byId("wrapper").childNodes[0]);
menuBar.id = "menuBar";
//Initializate the menubar
return this.init(menuBar);
},
/**
* Initializate a menubar
*
* @param {HTMLElement} menuElem The menu container
* @return {Boolan} True for a success
*/
init: function(menuElem){
//Log action
ComunicWeb.debug.logMessage("Info: Initializate a menuBar on element : '"+menuElem.id+"'");
},
};

View File

@ -57,6 +57,7 @@ $config['JSfiles'] = array(
"%PATH_ASSETS%js/user/userInfos.js", "%PATH_ASSETS%js/user/userInfos.js",
//Pages scripts //Pages scripts
"%PATH_ASSETS%js/pages/menuBar.js",
"%PATH_ASSETS%js/pages/home/home.js", "%PATH_ASSETS%js/pages/home/home.js",
"%PATH_ASSETS%js/pages/login.js", "%PATH_ASSETS%js/pages/login.js",
"%PATH_ASSETS%js/pages/logout.js", "%PATH_ASSETS%js/pages/logout.js",