Splited bottom links list and rendering

This commit is contained in:
Pierre HUBERT 2019-01-11 11:11:25 +01:00
parent f418ee25b0
commit fba7937d02
4 changed files with 44 additions and 18 deletions

View File

@ -592,6 +592,13 @@ var ComunicWeb = {
*/ */
bottom: { bottom: {
/**
* Bottom links
*/
links: [
//TODO : implement
],
/** /**
* Main bottom script file * Main bottom script file
*/ */

View File

@ -0,0 +1,21 @@
/**
* Comunic bottom links list
*
* @author Pierre HUBERT
*/
ComunicWeb.components.bottom.links = [
//Language selector
{
innerHTML: "<i class='fa fa-globe'></i> Language",
onclick: function(){ComunicWeb.components.langPicker.show();}
},
//About Comunic
{
innerHTML: "<i class='fa fa-question-circle'></i> About",
href: ComunicWeb.__config.aboutWebsiteURL,
target: "_blank"
}
];

View File

@ -43,27 +43,24 @@ ComunicWeb.components.bottom.main = {
innerHTML: "Comunic &nbsp; &nbsp; " innerHTML: "Comunic &nbsp; &nbsp; "
}); });
//Put the language selector link on the right ComunicWeb.components.bottom.links.forEach(function(link){
var langLink = createElem2({
var linkEl = createElem2({
appendTo: leftElements, appendTo: leftElements,
type: "a", type: "a",
innerHTML: "<i class='fa fa-globe'></i> Language" href: link.href,
innerHTML: link.innerHTML
}); });
langLink.onclick = function(){
ComunicWeb.components.langPicker.show(); if(link.target)
}; linkEl.setAttribute("target", link.target);
if(link.onclick)
linkEl.onclick = link.onclick;
add_space(leftElements); add_space(leftElements);
add_space(leftElements); add_space(leftElements);
//Add about link
var aboutLink = createElem2({
appendTo: leftElements,
type: "a",
innerHTML: "<i class='fa fa-question-circle'></i> About",
href: ComunicWeb.__config.aboutWebsiteURL
}); });
aboutLink.setAttribute("target", "_blank");
} }
} }

View File

@ -339,6 +339,7 @@ class Dev {
"js/components/menuBar/authenticated.js", "js/components/menuBar/authenticated.js",
//Bottom view //Bottom view
"js/components/bottom/links.js",
"js/components/bottom/main.js", "js/components/bottom/main.js",
//Language picker //Language picker