From 335b3d2f9eddb37de90996a1dabb404b8e453031 Mon Sep 17 00:00:00 2001 From: nathangray Date: Mon, 18 Dec 2017 14:51:07 -0700 Subject: [PATCH] Etemplate - make sure nextmatch action popups get properly closed --- api/js/etemplate/et2_extension_nextmatch_actions.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/api/js/etemplate/et2_extension_nextmatch_actions.js b/api/js/etemplate/et2_extension_nextmatch_actions.js index fe38b39b46..b6432f2d3e 100644 --- a/api/js/etemplate/et2_extension_nextmatch_actions.js +++ b/api/js/etemplate/et2_extension_nextmatch_actions.js @@ -420,6 +420,10 @@ function nm_open_popup(_action, _selected) var d_buttons = []; var action = _action; popup.show(); + var close_function = function() + { + dialog_parent.append(dialog); + }; jQuery('button:visible',popup).each(function(index) { var but = jQuery(this); if(but.attr("id")) @@ -435,9 +439,11 @@ function nm_open_popup(_action, _selected) jQuery(this).dialog("close"); nm_popup_action = action; button.onclick.apply(button, e.currentTarget); + close_function(); } : function(e) { jQuery(this).dialog("close"); nm_popup_action = null; + close_function(); } }; if(button && button.options && button.options.image) @@ -448,9 +454,8 @@ function nm_open_popup(_action, _selected) }); popup.hide(); - var _dialog = et2_dialog.show_dialog(function() { - dialog_parent.append(dialog); - }, + var _dialog = et2_dialog.show_dialog( + close_function, '', jQuery('.promptheader',popup).text(), {},