From f99dcf8fdc084dac6b30e141f901bd769fa57e96 Mon Sep 17 00:00:00 2001 From: Pierre Date: Sun, 4 Jun 2017 18:17:27 +0200 Subject: [PATCH] Added open a conversation button --- assets/css/components/discussions/manager.css | 20 ++++++++++++++++ assets/js/components/discussions/manager.js | 23 +++++++++++++++++++ corePage/config/dev.config.php | 1 + 3 files changed, 44 insertions(+) create mode 100644 assets/css/components/discussions/manager.css diff --git a/assets/css/components/discussions/manager.css b/assets/css/components/discussions/manager.css new file mode 100644 index 00000000..24f2ff3d --- /dev/null +++ b/assets/css/components/discussions/manager.css @@ -0,0 +1,20 @@ +/** + * Discussions manager stylesheet + * + * @author Pierre HUBERT + */ + +#discussionsElem { + position: fixed; + bottom: 0px; + width: 100%; + text-align: right; + padding-right: 5px; +} + +#discussionsElem .open-conversation-button { + border-top-left-radius: 2px; + border-top-right-radius: 2px; + border-bottom-left-radius: 0px; + border-bottom-right-radius: 0px; +} \ No newline at end of file diff --git a/assets/js/components/discussions/manager.js b/assets/js/components/discussions/manager.js index 5d9c04a3..5c6a5db2 100644 --- a/assets/js/components/discussions/manager.js +++ b/assets/js/components/discussions/manager.js @@ -54,6 +54,29 @@ ComunicWeb.components.discussions.manager = { * @return {Boolean} True for a success */ init: function(discussionsContainerElem){ + + //First, add the "open a conversation" new + this.addOpenConversationButton(discussionsContainerElem); }, + + /** + * Add the "open conversation" button + * + * @param {HTMLElement} targetElem The target of the button + * @return {Boolean} True for a success + */ + addOpenConversationButton: function(targetElem){ + + //Create the button + var addButton = createElem("button", targetElem); + addButton.className = "btn btn-primary open-conversation-button"; + addButton.innerHTML = "Open a conversation"; + + + //Temporary behavior + addButton.onclick = function(){ + alert("Open a conversation !"); + } + } } \ No newline at end of file diff --git a/corePage/config/dev.config.php b/corePage/config/dev.config.php index 0e5d319d..66a02bd2 100644 --- a/corePage/config/dev.config.php +++ b/corePage/config/dev.config.php @@ -26,6 +26,7 @@ $config['CSSfiles'] = array( "%PATH_ASSETS%css/components/menuBar.css", "%PATH_ASSETS%css/components/searchForm.css", "%PATH_ASSETS%css/components/friends/friendsBar.css", + "%PATH_ASSETS%css/components/discussions/manager.css", ); //JS files to include (at the end of the page)