mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 11:08:45 +02:00
* N°2039 - Rework view all notifications page * N°2039 - Replace modals with toasts * N°2039 - Add bulk mode to view all notifications page * Apply suggestions from code review Co-authored-by: Molkobain <lajarige.guillaume@free.fr> * Apply suggestions from code review Co-authored-by: Molkobain <lajarige.guillaume@free.fr> * Apply suggestions from code review Co-authored-by: Molkobain <lajarige.guillaume@free.fr> * Apply suggestions from code review Co-authored-by: Molkobain <lajarige.guillaume@free.fr> * Apply suggestions from code review Co-authored-by: Molkobain <lajarige.guillaume@free.fr> * Update css/backoffice/pages/_notifications.scss * Update dictionaries/ui/application/newsroom/fr.dictionary.itop.newsroom.php * Apply suggestions from code review Co-authored-by: Molkobain <lajarige.guillaume@free.fr> * Add since in phpdoc * Change newsroom empty notification illustration * N°2039 - Refactor code to factorize logic --------- Co-authored-by: Molkobain <lajarige.guillaume@free.fr>
35 lines
1.8 KiB
JavaScript
35 lines
1.8 KiB
JavaScript
$('body').on('change', '.ibo-toggler', function() {
|
|
$('.ibo-notifications--view-all--bulk-buttons').toggleClass('ibo-is-hidden');
|
|
$('.ibo-object-summary').toggleClass('ibo-is-selectable').removeClass('ibo-is-selected');
|
|
});
|
|
|
|
$('body').on('click', '.ibo-object-summary.ibo-is-selectable', function() {
|
|
$(this).toggleClass('ibo-is-selected');
|
|
});
|
|
|
|
$('body').on('itop.notification.deleted', '.ibo-notifications--view-all--container', function() {
|
|
if($(this).find('.ibo-object-summary').length === 0) {
|
|
$('.ibo-notifications--view-all--empty').removeClass('ibo-is-hidden');
|
|
$('.ibo-notifications--view-all--container').addClass('ibo-is-hidden');
|
|
$('.ibo-notifications--view-all--read-action').attr('disabled', 'disabled');
|
|
$('.ibo-notifications--view-all--unread-action').attr('disabled', 'disabled');
|
|
$('.ibo-notifications--view-all--delete-action').attr('disabled', 'disabled');
|
|
}
|
|
});
|
|
|
|
let fReadUnreadDisabled = function() {
|
|
if($('.ibo-object-summary.ibo-notifications--view-all--item--unread').length === 0) {
|
|
$('.ibo-notifications--view-all--read-action').attr('disabled', 'disabled');
|
|
$('.ibo-notifications--view-all--unread-action').removeAttr('disabled');
|
|
} else if ($('.ibo-object-summary.ibo-notifications--view-all--item--read').length === 0) {
|
|
$('.ibo-notifications--view-all--read-action').removeAttr('disabled');
|
|
$('.ibo-notifications--view-all--unread-action').attr('disabled', 'disabled');
|
|
} else {
|
|
$('.ibo-notifications--view-all--read-action').removeAttr('disabled');
|
|
$('.ibo-notifications--view-all--unread-action').removeAttr('disabled');
|
|
}
|
|
}
|
|
|
|
$('body').on('itop.notification.read itop.notification.unread', '.ibo-notifications--view-all--container', fReadUnreadDisabled);
|
|
|
|
$('body').on('itop.notification.unread', '.ibo-notifications--view-all--container', fReadUnreadDisabled); |