From 1aee6f3bed067d4316f51772ef81902b75761101 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Mon, 28 Apr 2014 20:20:54 +0000 Subject: [PATCH] Enhance auto-popup to only show visible buttons --- etemplate/js/et2_extension_nextmatch_actions.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/etemplate/js/et2_extension_nextmatch_actions.js b/etemplate/js/et2_extension_nextmatch_actions.js index 65662fabd9..ec30eddb3b 100644 --- a/etemplate/js/et2_extension_nextmatch_actions.js +++ b/etemplate/js/et2_extension_nextmatch_actions.js @@ -374,7 +374,8 @@ function nm_open_popup(_action, _ids) var dialog_parent = dialog.parent(); var d_buttons = []; var action = _action; - jQuery('button',popup).each(function(index) { + popup.show(); + var buttons = jQuery('button:visible',popup).each(function(index) { var but = jQuery(this); but.hide(); if(but.attr("id")) @@ -395,6 +396,7 @@ function nm_open_popup(_action, _ids) } }); }); + popup.hide(); dialog.dialog({ title: jQuery('.promptheader',popup).text(), modal: true, @@ -406,6 +408,7 @@ function nm_open_popup(_action, _ids) // Put it back where it came from, or et2 will error when clear() is called dialog.appendTo(dialog_parent); + buttons.show(); } }); }