mirror of
https://github.com/pierre42100/ComunicWeb
synced 2024-12-24 01:48:50 +00:00
Added sitename on menubar
This commit is contained in:
parent
6e50fa0894
commit
ba3f2fb246
@ -151,6 +151,10 @@ ComunicWeb.common.page = {
|
||||
var pageTarget = createElem("div", mainContenerElem);
|
||||
pageTarget.id = "pageTarget";
|
||||
}
|
||||
else{
|
||||
//We can empty page target (much faster)
|
||||
pageTarget.innerHTML = "";
|
||||
}
|
||||
|
||||
//Set wrapper class
|
||||
pageTarget.className = "content-wrapper";
|
||||
|
@ -25,7 +25,7 @@ ComunicWeb.pages.menuBar = {
|
||||
|
||||
//So we have to initializate it
|
||||
//Create menubar element
|
||||
var menuBar = createElem("div");
|
||||
var menuBar = createElem("header");
|
||||
byId("wrapper").insertBefore(menuBar, byId("wrapper").childNodes[0]);
|
||||
menuBar.id = "menuBar";
|
||||
|
||||
@ -36,13 +36,39 @@ ComunicWeb.pages.menuBar = {
|
||||
/**
|
||||
* Initializate a menubar
|
||||
*
|
||||
* @param {HTMLElement} menuElem The menu container
|
||||
* @param {HTMLElement} menuContainer The menu container
|
||||
* @return {Boolan} True for a success
|
||||
*/
|
||||
init: function(menuElem){
|
||||
init: function(menuContainer){
|
||||
//Log action
|
||||
ComunicWeb.debug.logMessage("Info: Initializate a menuBar on element : '"+menuElem.id+"'");
|
||||
ComunicWeb.debug.logMessage("Info: Initializate a menuBar in element : '"+menuContainer.id+"'");
|
||||
|
||||
//Change menu container informations
|
||||
menuContainer.className = "main-header";
|
||||
|
||||
//Create main menu
|
||||
var menuElem = createElem("div", menuContainer);
|
||||
menuElem.className = "navbar navbar-static-top";
|
||||
|
||||
//Create nav element
|
||||
var navElem = createElem("nav", menuElem);
|
||||
navElem.className = "navbar navbar-static-top";
|
||||
|
||||
//Create conatiner
|
||||
var containerElem = createElem("div", navElem);
|
||||
containerElem.className = "container";
|
||||
|
||||
//Create navbar header
|
||||
var navbarHeader = createElem("div", containerElem);
|
||||
navbarHeader.className = "navbar-header";
|
||||
|
||||
//Create site name link
|
||||
var siteNameElem = createElem("a", navbarHeader);
|
||||
siteNameElem.className = "navbar-brand";
|
||||
siteNameElem.innerText = "Comunic";
|
||||
siteNameElem.onclick = (function(){
|
||||
ComunicWeb.common.page.openPage("home");
|
||||
});
|
||||
|
||||
|
||||
},
|
||||
};
|
Loading…
Reference in New Issue
Block a user