Better way to avoid JS errors if nextmatch is disabled

This commit is contained in:
nathangray 2019-04-01 16:49:28 -06:00
parent eb45eea505
commit bec4eb8cf1

View File

@ -1741,6 +1741,11 @@ var et2_nextmatch = (function(){ "use strict"; return et2_DOMWidget.extend([et2_
return; return;
} }
if(this.options.disabled)
{
return;
}
// Deferred parse function - template might not be fully loaded // Deferred parse function - template might not be fully loaded
var parse = function(template) var parse = function(template)
{ {
@ -1798,20 +1803,17 @@ var et2_nextmatch = (function(){ "use strict"; return et2_DOMWidget.extend([et2_
template.loadingFinished(promise); template.loadingFinished(promise);
// Wait until template (& children) are done // Wait until template (& children) are done
if(!this.options.disabled) jQuery.when.apply(null, promise).done(
{ jQuery.proxy(function() {
jQuery.when.apply(null, promise).done( parse.call(this, template);
jQuery.proxy(function() { if(!this.dynheight)
parse.call(this, template); {
if(!this.dynheight) this.dynheight = this._getDynheight(this);
{ }
this.dynheight = this._getDynheight(this); this.dynheight.initialized = false;
} this.resize();
this.dynheight.initialized = false; }, this)
this.resize(); );
}, this)
);
}
}, },
// Some accessors to match conventions // Some accessors to match conventions