diff --git a/pandora_console/include/javascript/pandora_events.js b/pandora_console/include/javascript/pandora_events.js index 8e600c024b..b8d426e8ba 100644 --- a/pandora_console/include/javascript/pandora_events.js +++ b/pandora_console/include/javascript/pandora_events.js @@ -955,8 +955,8 @@ function openSoundEventsDialog(settings) { return; } //Modify button - $("#minimize_arrow_event_sound").removeClass("arrow_menu_down"); - $("#minimize_arrow_event_sound").addClass("arrow_menu_up"); + $("#minimize_arrow_event_sound").removeClass("arrow_menu_up"); + $("#minimize_arrow_event_sound").addClass("arrow_menu_down"); $("#minimize_arrow_event_sound").show(); // Initialize modal. @@ -1370,180 +1370,168 @@ function removeElement(name_select, id_modal) { $(document).ajaxSend(function(event, jqXHR, ajaxOptions) { const requestBody = ajaxOptions.data; - if (requestBody && requestBody.includes("drawConsoleSound=1")) { - console.log("AJAX request sent with drawConsoleSound=1:", ajaxOptions.url); + try { + if (requestBody && requestBody.includes("drawConsoleSound=1")) { + console.log( + "AJAX request sent with drawConsoleSound=1:", + ajaxOptions.url + ); - // Find the dialog element by the aria-describedby attribute - var dialog = $('[aria-describedby="modal-sound"]'); + // Find the dialog element by the aria-describedby attribute + var dialog = $('[aria-describedby="modal-sound"]'); - // Select the close button within the dialog - var closeButton = dialog.find(".ui-dialog-titlebar-close"); + // Select the close button within the dialog + var closeButton = dialog.find(".ui-dialog-titlebar-close"); - // Add the minimize button before the close button - var minimizeButton = $("