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