From: Coleman Watts Date: Wed, 3 Feb 2016 05:20:48 +0000 (-0700) Subject: CRM-17960 - Handle redirects in popups X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=217bfb2e8828432180aebe959e1c83e8555ee87e;p=civicrm-core.git CRM-17960 - Handle redirects in popups --- diff --git a/js/crm.ajax.js b/js/crm.ajax.js index 91565ef603..b01e814bf0 100644 --- a/js/crm.ajax.js +++ b/js/crm.ajax.js @@ -240,6 +240,10 @@ if (this.options.crmForm) $('form', this.element).ajaxFormUnbind(); if (this.options.block) this.element.block(); $.getJSON(url, function(data) { + if (data.status === 'redirect') { + that.options.url = data.userContext; + return that.refresh(); + } if (that.options.block) that.element.unblock(); if (!$.isPlainObject(data)) { that._onFailure(data); @@ -276,13 +280,6 @@ $('.blockUI', this.element).remove(); this._originalContent = this.element.contents().detach(); } - if (window.tinyMCE && tinyMCE.editors) { - $.each(tinyMCE.editors, function(k) { - if ($.contains(that.element[0], this.getElement())) { - this.remove(); - } - }); - } if (this.options.crmForm) $('form', this.element).ajaxFormUnbind(); }, _destroy: function() { @@ -442,7 +439,7 @@ }, settings.ajaxForm)); if (settings.openInline) { settings.autoClose = $el.crmSnippet('isOriginalUrl'); - $(this).on('click', settings.openInline, function(e) { + $(this).off('.openInline').on('click.openInline', settings.openInline, function(e) { if ($(this).is(exclude + ', .crm-popup')) { return; }