mirror of
https://github.com/pierre42100/ComunicWeb
synced 2024-11-26 05:49:22 +00:00
Menubar ready to be created
This commit is contained in:
parent
7b6163328a
commit
6e50fa0894
@ -301,10 +301,17 @@ var ComunicWeb = {
|
||||
},
|
||||
|
||||
/**
|
||||
* Pages functions
|
||||
* Pages controllers
|
||||
*/
|
||||
pages:{
|
||||
|
||||
/**
|
||||
* Menubar
|
||||
*/
|
||||
menuBar: {
|
||||
//TODO: implement
|
||||
},
|
||||
|
||||
/**
|
||||
* Home page
|
||||
*/
|
||||
|
@ -153,13 +153,13 @@ ComunicWeb.common.page = {
|
||||
}
|
||||
|
||||
//Set wrapper class
|
||||
mainContenerElem.className = "content-wrapper";
|
||||
pageTarget.className = "content-wrapper";
|
||||
|
||||
//Set body class
|
||||
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
|
||||
|
48
assets/js/pages/menuBar.js
Normal file
48
assets/js/pages/menuBar.js
Normal 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+"'");
|
||||
|
||||
|
||||
},
|
||||
};
|
@ -57,6 +57,7 @@ $config['JSfiles'] = array(
|
||||
"%PATH_ASSETS%js/user/userInfos.js",
|
||||
|
||||
//Pages scripts
|
||||
"%PATH_ASSETS%js/pages/menuBar.js",
|
||||
"%PATH_ASSETS%js/pages/home/home.js",
|
||||
"%PATH_ASSETS%js/pages/login.js",
|
||||
"%PATH_ASSETS%js/pages/logout.js",
|
||||
|
Loading…
Reference in New Issue
Block a user