From eb45eea50569961f238674b0ad29cbf819e266c6 Mon Sep 17 00:00:00 2001 From: nathangray Date: Mon, 1 Apr 2019 16:30:53 -0600 Subject: [PATCH] Avoid JS errors if nextmatch is disabled --- api/js/etemplate/et2_extension_nextmatch.js | 25 ++++++++++++--------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/api/js/etemplate/et2_extension_nextmatch.js b/api/js/etemplate/et2_extension_nextmatch.js index 9eef6e49a3..4f0a941321 100644 --- a/api/js/etemplate/et2_extension_nextmatch.js +++ b/api/js/etemplate/et2_extension_nextmatch.js @@ -1798,17 +1798,20 @@ var et2_nextmatch = (function(){ "use strict"; return et2_DOMWidget.extend([et2_ template.loadingFinished(promise); // Wait until template (& children) are done - 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) - ); + 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) + ); + } }, // Some accessors to match conventions