From: Coleman Watts Date: Mon, 16 Mar 2015 15:39:46 +0000 (-0400) Subject: CRM-16117 - Fix content disappearing when ajax paging X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=8d6a383065eb52150d3cf0cd7484d7fb57ff398e;p=civicrm-core.git CRM-16117 - Fix content disappearing when ajax paging --- diff --git a/js/crm.ajax.js b/js/crm.ajax.js index 7c22c3ddd9..02a4a6312b 100644 --- a/js/crm.ajax.js +++ b/js/crm.ajax.js @@ -252,9 +252,6 @@ var that = this; var url = this._formatUrl(this.options.url); if (this.options.crmForm) $('form', this.element).ajaxFormUnbind(); - if (this._originalContent === null) { - this._originalContent = this.element.contents().detach(); - } if (this.options.block) this.element.block(); $.getJSON(url, function(data) { if (that.options.block) that.element.unblock(); @@ -280,6 +277,11 @@ // Perform any cleanup needed before removing/replacing content _beforeRemovingContent: function() { var that = this; + // Save original content to be restored if widget is destroyed + if (this._originalContent === null) { + $('.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())) {