From 698c4f08af4fda9e8fdfb9a32def41dd6ef294e4 Mon Sep 17 00:00:00 2001 From: Pierre Date: Sun, 4 Jun 2017 16:42:38 +0200 Subject: [PATCH] Work progess on discussions manager --- assets/js/components/discussions/manager.js | 30 ++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/assets/js/components/discussions/manager.js b/assets/js/components/discussions/manager.js index b51a87fb..5d9c04a3 100644 --- a/assets/js/components/discussions/manager.js +++ b/assets/js/components/discussions/manager.js @@ -25,7 +25,35 @@ ComunicWeb.components.discussions.manager = { //Else inform user and create discussion manager ComunicWeb.debug.logMessage("INFO : initializate discussion manager"); + //Create discussions manager element + var discussionsContainerElem = createElem("div"); + discussionsContainerElem.id = "discussionsElem"; + + //Insert the element at the right place + var pageTarget = byId("pageTarget"); + if(pageTarget){ + //Insert disucssion element before it + byId("wrapper").insertBefore(discussionsContainerElem, pageTarget); + } + else{ + //Just apply the element + byId("wrapper").appendChild(discussionsContainerElem); + } + + //Initializate discussion element + this.init(discussionsContainerElem); + //Success return true; - } + }, + + /** + * Initializate discussions element + * + * @param {HTMLElement} discussionsContainerElem The container of the discussion element + * @return {Boolean} True for a success + */ + init: function(discussionsContainerElem){ + + }, } \ No newline at end of file