From 9317128cef73f26b4a9bead9a9265f2424313e76 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Tue, 26 Aug 2014 16:15:24 +0100 Subject: [PATCH] CRM-15149 - Close popup after deleting an object (don't try to view it) --- js/crm.ajax.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/crm.ajax.js b/js/crm.ajax.js index 961c186215..2e3c1f81b9 100644 --- a/js/crm.ajax.js +++ b/js/crm.ajax.js @@ -412,7 +412,8 @@ $el.data('civiCrmSnippet')._originalUrl = response.userContext; $el.crmSnippet('resetUrl').crmSnippet('refresh'); } - else if ($el.data('uiDialog') && settings.autoClose) { + // Close if we are on the original url or the action was "delete" (in which case returning to view may be inappropriate) + else if ($el.data('uiDialog') && (settings.autoClose || response.action === 8)) { $el.dialog('close'); } else if (settings.autoClose === false) { -- 2.25.1