mirror of
https://github.com/pierre42100/ComunicWeb
synced 2024-12-24 18:08:50 +00:00
Created notifications dropdown toggle.
This commit is contained in:
parent
e4a3ab254d
commit
cb1319f02c
@ -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
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -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);
|
||||||
|
|
||||||
|
45
assets/js/components/notifications/dropdown.js
Normal file
45
assets/js/components/notifications/dropdown.js
Normal 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
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
}
|
@ -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",
|
||||||
|
Loading…
Reference in New Issue
Block a user