diff --git a/include/bottom.php b/include/bottom.php
index eb75e5a33..2e08b1d4b 100644
--- a/include/bottom.php
+++ b/include/bottom.php
@@ -65,16 +65,16 @@ if (Auth::check()) {
hooks = JSON.parse(data);
hooks.forEach(function(item, index){
- executeHook(item);
+ executeHook(item, hooks.length);
});
},
});
});
- function executeHook(hook){
- $("#hooks").append("
'.tr('Hook _NAME_ in esecuzione', [
- '_NAME_' => '\"" + hook.name + "\"',
- ]).'");
+ function executeHook(hook, length){
+ $("#hooks").append(\''.tr('Hook "_NAME_" in esecuzione', [
+ '_NAME_' => '\' + hook.name + \'',
+ ]).'\');
$.ajax({
url: globals.rootdir + "/ajax.php",
@@ -87,14 +87,24 @@ if (Auth::check()) {
result = JSON.parse(data);
$("#hook-loader-" + hook.id).remove();
- $("#hooks").append(" " + result.message + "");
- $("#hook-header").hide();
+ message = \' \' + result.message + \'\';
+ // Inserimento della notifica
if(result.notify) {
- number = parseInt($("#hook-count").text());
+ hooks_count = $("#hooks-count");
+ number = parseInt(hooks_count.text());
number = isNaN(number) ? 0 : number;
- $("#hook-count").text(parseInt(number) + 1);
+ hooks_count.text(parseInt(number) + 1);
+
+ $("#hooks").prepend(message);
+ } else {
+ $("#hooks").append(message);
+ }
+
+ // Rimozione eventuale della rotella di caricamento
+ if($(".hook-element").length == hooks.length) {
+ $("#hooks-loading").hide();
}
},
});
diff --git a/include/top.php b/include/top.php
index 5abaab319..1eab03e4e 100644
--- a/include/top.php
+++ b/include/top.php
@@ -225,10 +225,12 @@ if (Auth::check()) {