From 4917b40d10de721d113338e64605c8df84a298fe Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Mon, 27 Feb 2023 10:05:16 +0100 Subject: [PATCH] 10324 fixed modal in filter title --- pandora_console/include/functions_ui.php | 5 ++++- pandora_console/include/javascript/pandora_ui.js | 9 +++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index d411884a44..764427a25b 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -7129,7 +7129,10 @@ function ui_print_fav_menu($id_element, $url, $label, $section) base64_encode(json_encode($config_fav_menu)), '', true, - ['onclick' => 'favMenuAction(this)'] + [ + 'onclick' => 'favMenuAction(this)', + 'class' => (($fav !== false) ? 'active' : ''), + ] ); $output .= ''; $output .= '
'; diff --git a/pandora_console/include/javascript/pandora_ui.js b/pandora_console/include/javascript/pandora_ui.js index 3f99e1a675..17cb359818 100644 --- a/pandora_console/include/javascript/pandora_ui.js +++ b/pandora_console/include/javascript/pandora_ui.js @@ -837,12 +837,7 @@ function unblockSubmit(button) { function favMenuAction(e) { var data = JSON.parse(atob(e.value)); - if ( - data.label === "" && - $(e) - .attr("src") - .endsWith("star.png") === false - ) { + if (data.label === "" && $(e).hasClass("active") === false) { $("#dialog-fav-menu").dialog({ title: "Please choose a title", width: 330, @@ -877,8 +872,10 @@ function favMenuAction(e) { if (res.success) { if (res.action === "create") { $("#image-fav-menu-action1").attr("src", "images/star_fav_menu.png"); + $("#image-fav-menu-action1").addClass("active"); } else { $("#image-fav-menu-action1").attr("src", "images/star_dark.png"); + $("#image-fav-menu-action1").removeClass("active"); } } }