Handle value set before taglist is created without errors

This commit is contained in:
Nathan Gray 2016-02-23 21:06:46 +00:00
parent 9e7838732b
commit 27720bdaa2

View File

@ -406,11 +406,8 @@ var et2_taglist = et2_selectbox.extend(
{ {
if (value === '' || value === null) value = []; if (value === '' || value === null) value = [];
var values = jQuery.isArray(value) ? jQuery.extend([],value) : [value]; var values = jQuery.isArray(value) ? jQuery.extend([],value) : [value];
this.options.value = values;
if(this.taglist == null) return; if(!value && this.taglist)
if(!value)
{ {
this.taglist.clear(true); this.taglist.clear(true);
return; return;
@ -458,6 +455,10 @@ var et2_taglist = et2_selectbox.extend(
} }
} }
this.options.value = values;
if(this.taglist == null) return;
this.taglist.setSelection(values); this.taglist.setSelection(values);
}, },