From 72a5be76f53b05bee19c63973e3582be042176ac Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Tue, 2 Feb 2016 22:25:37 -0700 Subject: [PATCH] CRM-17960 - Handle redirects in popups --- js/crm.ajax.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; } -- 2.25.1