From 21fe027a62cd2f0667c7d3f00e5b9d661271a4eb Mon Sep 17 00:00:00 2001 From: Jonathan Date: Mon, 5 Feb 2024 14:34:43 +0100 Subject: [PATCH 1/2] #12488 tips window move for clicks --- .../include/javascript/tipsWindow.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/pandora_console/include/javascript/tipsWindow.js b/pandora_console/include/javascript/tipsWindow.js index f066f65c49..33cb9d46d1 100644 --- a/pandora_console/include/javascript/tipsWindow.js +++ b/pandora_console/include/javascript/tipsWindow.js @@ -82,6 +82,7 @@ function removeInputImage(e) { } } function render({ title, text, url, files, method }) { + var positionButtonsBefore = $(".ui-dialog-buttonset").offset().top; $("#title_tip").html(title); $("#text_tip").html(text); if (url) { @@ -123,6 +124,7 @@ function render({ title, text, url, files, method }) { } }); activeCarousel(); + checkPositionButtons(positionButtonsBefore); } function close_dialog() { @@ -429,3 +431,18 @@ function validateImages() { }); return validate; } + +function checkPositionButtons(positionButtonsBefore) { + // posicion actual botones + var buttonsNow = $(".ui-dialog-buttonset").offset().top; + // Position of dialog + var dialogPosition = $(".dialog_tips").position().top; + var positionFinal; + if (positionButtonsBefore > buttonsNow) { + positionFinal = dialogPosition + (positionButtonsBefore - buttonsNow); + $(".dialog_tips").css("top", positionFinal); + } else if (positionButtonsBefore < buttonsNow) { + positionFinal = dialogPosition - (buttonsNow - positionButtonsBefore); + $(".dialog_tips").css("top", positionFinal); + } +} From 80c0f487742aa2befa24f1d8aa58874ec02062f3 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Mon, 5 Feb 2024 16:05:16 +0100 Subject: [PATCH 2/2] #12488 when px lower 0 default 100 --- pandora_console/include/javascript/tipsWindow.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pandora_console/include/javascript/tipsWindow.js b/pandora_console/include/javascript/tipsWindow.js index 33cb9d46d1..fc48de0c1c 100644 --- a/pandora_console/include/javascript/tipsWindow.js +++ b/pandora_console/include/javascript/tipsWindow.js @@ -440,9 +440,11 @@ function checkPositionButtons(positionButtonsBefore) { var positionFinal; if (positionButtonsBefore > buttonsNow) { positionFinal = dialogPosition + (positionButtonsBefore - buttonsNow); + positionFinal = positionFinal < 0 ? "100" : positionFinal; $(".dialog_tips").css("top", positionFinal); } else if (positionButtonsBefore < buttonsNow) { positionFinal = dialogPosition - (buttonsNow - positionButtonsBefore); + positionFinal = positionFinal < 0 ? "100" : positionFinal; $(".dialog_tips").css("top", positionFinal); } }