notifications: ack on click (#34244)
This commit is contained in:
parent
26589e80a1
commit
167dbc1617
|
@ -252,4 +252,27 @@ $(function() {
|
|||
}).focusout(function() {
|
||||
$('body').removeClass('focus-in');
|
||||
});
|
||||
|
||||
/* notifications */
|
||||
$('div.cell li.combo-notification').on('click', function(event) {
|
||||
var target_url = $(this).find('a').attr('href');
|
||||
if ($(this).hasClass('combo-notification-acked')) {
|
||||
if (target_url != '#') {
|
||||
window.location.href = target_url;
|
||||
}
|
||||
} else {
|
||||
var ack_url = $('body').data('api-root') + 'notification/ack/' + $(this).data('combo-notification-id');
|
||||
$.ajax({
|
||||
url: ack_url,
|
||||
success: function(html) {
|
||||
$(this).addClass('combo-notification-acked');
|
||||
if (target_url != '#') {
|
||||
window.location.href = target_url;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue