From ed6c6dfad5a232afe1002f9ca4c75456684ad633 Mon Sep 17 00:00:00 2001 From: Jose Gonzalez Date: Tue, 16 Feb 2021 13:43:10 +0100 Subject: [PATCH] Hide OK button meanwhile is loading data --- pandora_console/include/class/AgentWizard.class.php | 3 +++ pandora_console/include/javascript/pandora_ui.js | 6 ++++++ pandora_console/include/styles/pandora.css | 3 +++ 3 files changed, 12 insertions(+) diff --git a/pandora_console/include/class/AgentWizard.class.php b/pandora_console/include/class/AgentWizard.class.php index d9a42b7cfa..6094582691 100644 --- a/pandora_console/include/class/AgentWizard.class.php +++ b/pandora_console/include/class/AgentWizard.class.php @@ -5343,6 +5343,7 @@ class AgentWizard extends HTML function processListModules() { confirmDialog({ title: "", + hideOkButton: true, message: function() { var id = "div-" + uniqId(); var loading = ""; @@ -5381,6 +5382,8 @@ class AgentWizard extends HTML }, datatype: "html", success: function(data) { + // Show hidden OK button + $('.sub.ok.submit-next').removeClass('invisible_important'); $('#' + id).empty().append(data); }, error: function(e) { diff --git a/pandora_console/include/javascript/pandora_ui.js b/pandora_console/include/javascript/pandora_ui.js index 4e8bd4b264..880fd77b99 100644 --- a/pandora_console/include/javascript/pandora_ui.js +++ b/pandora_console/include/javascript/pandora_ui.js @@ -406,6 +406,7 @@ function load_modal(settings) { // eslint-disable-next-line no-unused-vars function confirmDialog(settings) { var randomStr = uniqId(); + var hideOkButton = ""; if (settings.size == undefined) { settings.size = 350; @@ -414,6 +415,10 @@ function confirmDialog(settings) { if (settings.maxHeight == undefined) { settings.maxHeight = 1000; } + // You can hide the OK button. + if (settings.hideOkButton != undefined) { + hideOkButton = "invisible_important "; + } if (typeof settings.message == "function") { $("body").append( @@ -447,6 +452,7 @@ function confirmDialog(settings) { { text: "Ok", class: + hideOkButton + "ui-widget ui-state-default ui-corner-all ui-button-text-only sub ok submit-next", click: function() { $(this).dialog("close"); diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 9a1ce23dca..31e7a60251 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -704,6 +704,9 @@ select:-internal-list-box { .invisible { display: none; } +.invisible_important { + display: none !important; +} .visible { display: block;