CRM-15149 - Close popup after deleting an object (don't try to view it)
authorColeman Watts <coleman@civicrm.org>
Tue, 26 Aug 2014 15:15:24 +0000 (16:15 +0100)
committerColeman Watts <coleman@civicrm.org>
Tue, 26 Aug 2014 15:15:24 +0000 (16:15 +0100)
js/crm.ajax.js

index 961c18621506da6623b3bb52c5852028b5e9e309..2e3c1f81b9f51d872b7d6098dc10afcbd58b880e 100644 (file)
               $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) {