1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-05 19:42:38 +02:00
This commit is contained in:
DanieL 2022-08-18 12:00:24 -03:00
parent 69457c1c8e
commit d68d17649e
2 changed files with 17 additions and 11 deletions

View file

@ -2,7 +2,7 @@
<li class="dropdown" id="topMenuUserNotifications" data-toggle="tooltip" title="<?php echo __('Notifications'); ?>" data-placement="bottom">
<a href="#" class="faa-parent animated-hover btn btn-default btn-light navbar-btn" data-toggle="dropdown" data-toggle="tooltip" title="<?php echo __('Notifications'); ?>" data-placement="bottom" >
<i class="fas fa-bell faa-ring"></i>
<span class="badge badge-notify animate_animated animate__bounceIn">0</span>
<span class="badge animate_animated animate__bounceIn">0</span>
<b class="caret"></b>
</a>
<ul class="dropdown-menu dropdown-menu-right">

View file

@ -111,15 +111,17 @@ function updateUserNotificationCount() {
_updateUserNotificationCountTimeout = setTimeout(function () {
var valueNow = parseInt($('#topMenuUserNotifications a > span.badge-notify').text());
var total = $('#topMenuUserNotifications > ul .list-group a').length;
if (total != valueNow) {
//Avoid dropdown menu close on click inside
$(document).on('click', '#topMenuUserNotifications .dropdown-menu', function (e) {
e.stopPropagation();
});
if (total <= 0) {
$('#topMenuUserNotifications .dropdown-menu').addClass('hidden');
$('#topMenuUserNotifications > a > span.badge').removeClass('badge-notify');
$('#topMenuUserNotifications > a > span.badge').text(0);
} else if (total != valueNow) {
$('#topMenuUserNotifications .dropdown-menu').removeClass('hidden');
$('#topMenuUserNotifications > a > span.badge').addClass('badge-notify');
animateChilds('#topMenuUserNotifications .dropdown-menu .list-group .priority', 'animate__bounceInRight', 0.05);
$('#topMenuUserNotifications a > span.badge-notify').hide();
$('#topMenuUserNotifications > a > span.badge').hide();
setTimeout(function () {
var selector = '#topMenuUserNotifications a > span.badge-notify';
var selector = '#topMenuUserNotifications > a > span.badge';
countToOrRevesrse(selector, total);
$(selector).show();
}, 1);
@ -267,5 +269,9 @@ function deleteAllNotifications() {
}
$(document).ready(function () {
//Avoid dropdown menu close on click inside
$(document).on('click', '#topMenuUserNotifications .dropdown-menu', function (e) {
e.stopPropagation();
});
getUserNotification();
});