10324 fixed modal in filter title

This commit is contained in:
Daniel Cebrian 2023-02-27 10:05:16 +01:00
parent e76d8606dc
commit 4917b40d10
2 changed files with 7 additions and 7 deletions

View File

@ -7129,7 +7129,10 @@ function ui_print_fav_menu($id_element, $url, $label, $section)
base64_encode(json_encode($config_fav_menu)), base64_encode(json_encode($config_fav_menu)),
'', '',
true, true,
['onclick' => 'favMenuAction(this)'] [
'onclick' => 'favMenuAction(this)',
'class' => (($fav !== false) ? 'active' : ''),
]
); );
$output .= '</span>'; $output .= '</span>';
$output .= '<div id="dialog-fav-menu">'; $output .= '<div id="dialog-fav-menu">';

View File

@ -837,12 +837,7 @@ function unblockSubmit(button) {
function favMenuAction(e) { function favMenuAction(e) {
var data = JSON.parse(atob(e.value)); var data = JSON.parse(atob(e.value));
if ( if (data.label === "" && $(e).hasClass("active") === false) {
data.label === "" &&
$(e)
.attr("src")
.endsWith("star.png") === false
) {
$("#dialog-fav-menu").dialog({ $("#dialog-fav-menu").dialog({
title: "Please choose a title", title: "Please choose a title",
width: 330, width: 330,
@ -877,8 +872,10 @@ function favMenuAction(e) {
if (res.success) { if (res.success) {
if (res.action === "create") { if (res.action === "create") {
$("#image-fav-menu-action1").attr("src", "images/star_fav_menu.png"); $("#image-fav-menu-action1").attr("src", "images/star_fav_menu.png");
$("#image-fav-menu-action1").addClass("active");
} else { } else {
$("#image-fav-menu-action1").attr("src", "images/star_dark.png"); $("#image-fav-menu-action1").attr("src", "images/star_dark.png");
$("#image-fav-menu-action1").removeClass("active");
} }
} }
} }