mirror of
https://github.com/myvesta/vesta
synced 2025-07-14 17:13:23 -07:00
notification centre improvements
This commit is contained in:
parent
1bb6ecb2ba
commit
addd9a8f02
34 changed files with 80 additions and 13 deletions
|
@ -406,12 +406,16 @@ VE.notifications.get_list = function(){
|
|||
acc.push(tpl.finalize());
|
||||
});
|
||||
|
||||
if(!Object.keys(data).length){
|
||||
var tpl = Tpl.get('notification_empty', 'WEB');
|
||||
acc.push(tpl.finalize());
|
||||
}
|
||||
|
||||
$('.notification-container').html(acc.done()).show();
|
||||
|
||||
$('.notification-container .mark-seen').click(function(event){
|
||||
/// TODO add token
|
||||
VE.notifications.mark_seen($(event.target).attr('id').replace("notification-", ""));
|
||||
// VE.notifications.delete($(event.target).attr('id').replace("notification-", ""));
|
||||
// VE.notifications.mark_seen($(event.target).attr('id').replace("notification-", ""));
|
||||
VE.notifications.delete($(event.target).attr('id').replace("notification-", ""));
|
||||
});
|
||||
|
||||
});
|
||||
|
@ -419,10 +423,12 @@ VE.notifications.get_list = function(){
|
|||
|
||||
|
||||
VE.notifications.delete = function(id){
|
||||
$('#notification-'+id).parents('li').remove();
|
||||
$('#notification-'+id).parents('li').hide();
|
||||
$.ajax({
|
||||
url: "/delete/notification/?delete=1¬ification_id="+id+"&token="+$('#token').attr('token')
|
||||
});
|
||||
if($('.notification-container li:visible').length == 0)
|
||||
$('.l-profile__notifications').removeClass('updates').removeClass('active');
|
||||
}
|
||||
|
||||
VE.notifications.mark_seen = function(id){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue