X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=js%2Fcrm.ajax.js;h=b01e814bf076d3c0613793ef8a43d97d5fd3e69b;hb=6290b1f2d238142d63dd79c2a5c8e278754c46ec;hp=a1284a765c101bc2372bd872a0912660dff9b553;hpb=8405167dd7e3615c071c59dba329144b46f3fe3e;p=civicrm-core.git diff --git a/js/crm.ajax.js b/js/crm.ajax.js index a1284a765c..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; } @@ -464,7 +461,7 @@ label = $el.is('input') ? $el.attr('value') : $el.text(), identifier = $el.attr('name') || $el.attr('href'); if (!identifier || identifier === '#' || $.inArray(identifier, added) < 0) { - var $icon = $el.find('.icon'), + var $icon = $el.find('.icon, .crm-i'), button = {'data-identifier': identifier, text: label, click: function() { $el[0].click(); }};