From 27720bdaa27a75d1f95b80a212e928676d47409f Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Tue, 23 Feb 2016 21:06:46 +0000 Subject: [PATCH] Handle value set before taglist is created without errors --- etemplate/js/et2_widget_taglist.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/etemplate/js/et2_widget_taglist.js b/etemplate/js/et2_widget_taglist.js index daf6c6bd27..ef5bb0308b 100644 --- a/etemplate/js/et2_widget_taglist.js +++ b/etemplate/js/et2_widget_taglist.js @@ -406,11 +406,8 @@ var et2_taglist = et2_selectbox.extend( { if (value === '' || value === null) value = []; var values = jQuery.isArray(value) ? jQuery.extend([],value) : [value]; - this.options.value = values; - if(this.taglist == null) return; - - if(!value) + if(!value && this.taglist) { this.taglist.clear(true); return; @@ -458,6 +455,10 @@ var et2_taglist = et2_selectbox.extend( } } + this.options.value = values; + + if(this.taglist == null) return; + this.taglist.setSelection(values); },