From: Coleman Watts Date: Wed, 3 Feb 2016 05:25:37 +0000 (-0700) Subject: CRM-17960 - Handle redirects in popups X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=72a5be76f53b05bee19c63973e3582be042176ac;p=civicrm-core.git CRM-17960 - Handle redirects in popups --- diff --git a/js/crm.ajax.js b/js/crm.ajax.js index 7c180cd724..ead47f874e 100644 --- a/js/crm.ajax.js +++ b/js/crm.ajax.js @@ -256,6 +256,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); @@ -470,7 +474,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; }