From 3164cb6dd0aec9f4d90ac56c7a02c020438dec6e Mon Sep 17 00:00:00 2001 From: nathan Date: Tue, 17 Jan 2023 15:35:28 -0700 Subject: [PATCH] Make sure we get the right popup if multiple nextmatches use the same popup ID --- api/js/etemplate/et2_extension_nextmatch_actions.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/js/etemplate/et2_extension_nextmatch_actions.js b/api/js/etemplate/et2_extension_nextmatch_actions.js index 624017e111..240743b0ff 100644 --- a/api/js/etemplate/et2_extension_nextmatch_actions.js +++ b/api/js/etemplate/et2_extension_nextmatch_actions.js @@ -442,14 +442,14 @@ export function nm_open_popup(_action, _selected) } // Find the popup div - var popup = document.body.querySelector("et2-dialog[id*='" + _action.id + "_popup']") || document.body.querySelector("#" + (uid || "") + "_" + _action.id + "_popup") || document.body.querySelector("[id*='" + _action.id + "_popup']"); + let nm = _action.data.nextmatch; + var popup = (nm?.getInstanceManager().DOMContainer || document.body).querySelector("et2-dialog[id*='" + _action.id + "_popup']") || document.body.querySelector("#" + (uid || "") + "_" + _action.id + "_popup") || document.body.querySelector("[id*='" + _action.id + "_popup']"); if (popup && popup instanceof Et2Dialog) { popup.show(); } else if (popup) { - let nm = _action.data.nextmatch; let dialog = new Et2Dialog(nm?.egw()); dialog.destroyOnClose = false; dialog.id = popup.id;