Created notifications dropdown toggle.

This commit is contained in:
Pierre 2018-02-18 19:12:17 +01:00
parent e4a3ab254d
commit cb1319f02c
4 changed files with 70 additions and 0 deletions

View File

@ -499,6 +499,8 @@ var ComunicWeb = {
* Add search form element * Add search form element
*/ */
addSearchForm: function(navbarElem){}, addSearchForm: function(navbarElem){},
//TODO : implement
}, },
}, },
@ -791,6 +793,23 @@ var ComunicWeb = {
}, },
/**
* Notifications components
*/
notifications: {
/**
* Notifications menu dropdown
*/
dropdown:{
//TODO : implement
}
}
}, },
/** /**

View File

@ -35,6 +35,9 @@ ComunicWeb.components.menuBar.authenticated = {
//Add friends list button //Add friends list button
this.addFriendListButton(navbarRightElemList); this.addFriendListButton(navbarRightElemList);
//Add notifications dropdown
ComunicWeb.components.notifications.dropdown.display(navbarRightElemList);
//Add dropdown menu //Add dropdown menu
this.addDropdown(navbarRightElemList); this.addDropdown(navbarRightElemList);

View File

@ -0,0 +1,45 @@
/**
* Notifications menu bar dropdown
*
* @author Pierre HUBERT
*/
ComunicWeb.components.notifications.dropdown = {
/**
* Display notifications dropdown
*
* @param {HTMLElement} target The target of the notification dropdown
*/
display: function(target){
//Create the button
var dropdown = createElem2({
appendTo: target,
type: "li",
class: "dropdown notifications-menu"
});
//Add dropdown toggle
var dropdownToggle = createElem2({
appendTo: dropdown,
type: "a",
class: "dropdown-toggle",
href: "#",
innerHTML: '<i class="fa fa-bell-o"></i>'
});
//Add notification number
var notificationsNumber = createElem2({
appendTo: dropdownToggle,
type: "span",
class: "label label-danger",
innerHTML: "0"
});
//Add dropdown menu
},
}

View File

@ -256,6 +256,9 @@ class Dev {
"js/components/movies/interface.js", "js/components/movies/interface.js",
"js/components/movies/picker.js", "js/components/movies/picker.js",
//Notifications
"js/components/notifications/dropdown.js",
//User scripts //User scripts
"js/user/loginTokens.js", "js/user/loginTokens.js",
"js/user/userLogin.js", "js/user/userLogin.js",