diff --git a/assets/js/common/page.js b/assets/js/common/page.js index f8c27337..bf087652 100644 --- a/assets/js/common/page.js +++ b/assets/js/common/page.js @@ -124,22 +124,41 @@ ComunicWeb.common.page = { ComunicWeb.common.url.changeURI(document.title, pageURI); //Get the main contener of the page - var mainContenerElem = document.getElementById("wrapper"); + var mainContenerElem =byId("wrapper"); //If we didn't get anything, clean the page and create a wrapper element if(!mainContenerElem){ var mainContenerElem = this.emptyPage(true); } - //We check if the page is a full screen page + //We check if the page is a full screen page or not if(pageInfos.disableMenus){ //We force the screen to be cleaned var mainContenerElem = this.emptyPage(true); - var pageTarget = mainContenerElem; + var pageTarget = mainContenerElem; //The page directly goes to the main target } //Else else { - //We try to locate menubar + + //We try to locate the target of the page + var pageTarget = byId("pageTarget"); + + //We empty screen if we couldn't rich it + if(!pageTarget){ + mainContenerElem.innerHTML = ""; + + //We create the pagetTarget element + var pageTarget = createElem("div", mainContenerElem); + pageTarget.id = "pageTarget"; + } + + //Set wrapper class + mainContenerElem.className = "content-wrapper"; + + //Set body class + document.body.className="hold-transition skin-blue layout-top-nav"; + + //We load the menu } diff --git a/assets/js/common/utils.js b/assets/js/common/utils.js index 4ef7f768..24689f83 100644 --- a/assets/js/common/utils.js +++ b/assets/js/common/utils.js @@ -12,13 +12,13 @@ * @return {HTMLElement} The newly created element */ function createElem(nodeType, appendTo){ - var newElem = document.createElement(nodeType); + var newElem = document.createElement(nodeType); - if(appendTo) - appendTo.appendChild(newElem); + if(appendTo) + appendTo.appendChild(newElem); - //Return result - return newElem; + //Return result + return newElem; } /** @@ -28,5 +28,5 @@ function createElem(nodeType, appendTo){ * @return {HTMLElement} The elemnt / False for a failure */ function byId(nodeName){ - return document.getElementById(nodeName); + return document.getElementById(nodeName); } \ No newline at end of file diff --git a/corePage/config/dev.config.php b/corePage/config/dev.config.php index fa633f11..578496d6 100644 --- a/corePage/config/dev.config.php +++ b/corePage/config/dev.config.php @@ -30,6 +30,9 @@ $config['JSfiles'] = array( "%PATH_ASSETS%adminLTE/plugins/jquery-ui/jquery-ui.min.js", "%PATH_ASSETS%adminLTE/plugins/iCheck/icheck.min.js", + //Utilities + "%PATH_ASSETS%js/common/utils.js", + //Functions schema "%PATH_ASSETS%js/common/functionsSchema.js",