diff --git a/include/bottom.php b/include/bottom.php index 545be7cfe..847c4328e 100644 --- a/include/bottom.php +++ b/include/bottom.php @@ -87,24 +87,43 @@ if (Auth::check()) { result = JSON.parse(data); $("#hook-loader-" + hook.id).remove(); - message = \'
  • \' + result.message + \'
  • \'; - - // Inserimento della notifica - if(result.notify) { - hooks_count = $("#hooks-count"); - number = parseInt(hooks_count.text()); - number = isNaN(number) ? 0 : number; - - hooks_count.text(parseInt(number) + 1); - - $("#hooks").prepend(message); - } else { - $("#hooks").append(message); - } + + + + notification = \'
  • \' + result.message + \'
  • \'; + + // Inserimento della notifica + if(result.notify) { + hooks_count = $("#hooks-count"); + number = parseInt(hooks_count.text()); + number = isNaN(number) ? 0 : number; + + hooks_count.text(parseInt(number) + 1); + + $("#hooks").prepend(notification); + } else { + $("#hooks").append(notification); + } + + // Rimozione eventuale della rotella di caricamento if($(".hook-element").length == hooks.length) { - $("#hooks-loading").hide(); + + $(".notifications-menu .dropdown-toggle").attr(\'data-toggle\',\'dropdown\'); + $(".notifications-menu .dropdown-toggle").removeClass(\'disabled\'); + + $("#hooks-loading").hide(); + + if (hooks.length>0){ + $("#hooks-header").append(\''.tr('Hai _NUM_ notific_END_', [ + '_NUM_' => '\' + (parseInt(number) + 1) + \'', + '_END_' => '\' + ((parseInt(number) === 0) ? \''.tr('a').'\' : \''.tr('he').'\') + \'', + ]).'\'); + }else{ + $("#hooks-header").append(\''.tr('Nessuna notifica').'\'); + } + } }, }); diff --git a/include/top.php b/include/top.php index 55a5ecb89..0cf0d69e3 100644 --- a/include/top.php +++ b/include/top.php @@ -228,8 +228,8 @@ if (Auth::check()) {