From d0e7682b013317a30f9b46e493d5996c312d71de Mon Sep 17 00:00:00 2001 From: Pierre Date: Mon, 19 Feb 2018 09:46:51 +0100 Subject: [PATCH] Prepared notifications list refresh. --- .../js/components/notifications/dropdown.js | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/assets/js/components/notifications/dropdown.js b/assets/js/components/notifications/dropdown.js index 03b3f148..06621545 100644 --- a/assets/js/components/notifications/dropdown.js +++ b/assets/js/components/notifications/dropdown.js @@ -53,8 +53,38 @@ ComunicWeb.components.notifications.dropdown = { innerHTML: "Notifications" }); + //Add notifications list + var notificationsList = createElem2({ + appendTo: dropdownMenu, + type: "ul", + class: "menu" + }); + + //Enable slimscroll + $(notificationsList).slimScroll({ + height: '100%' + }); + //Initialize service ComunicWeb.components.notifications.service.init(notificationsNumber, true); + + //Refresh the notifications list if the user click the dropdown button + dropdownToggle.onclick = function(){ + + ComunicWeb.components.notifications.dropdown.refresh_list(notificationsList); + + } + }, + /** + * Refresh the list of notifications + * + * @param {HTMLElement} list The notifications list to refresh + */ + refresh: function(list){ + + //Perform a request on the database + + }, } \ No newline at end of file