Fix broken check in current selection causing missing labels

This commit is contained in:
Nathan Gray 2016-03-14 21:45:40 +00:00
parent 09e3000cb6
commit 9b70d4bb50

View File

@ -701,11 +701,7 @@ var et2_taglist = (function(){ "use strict"; return et2_selectbox.extend([et2_IR
// Check options
(result = $j.grep(this.options.select_options, function(e) {
return e.id == v;
})) ||
// Check current selection to avoid going back to server
(result = $j.grep(this.taglist.getSelection(), function(e) {
return e.id == v;
}))
})) && result.length
)
{
// Options should have been provided, but they weren't
@ -719,6 +715,17 @@ var et2_taglist = (function(){ "use strict"; return et2_selectbox.extend([et2_IR
label: v
};
}
else if (
// Check current selection to avoid going back to server
(result = $j.grep(this.taglist.getSelection(), function(e) {
return e.id == v;
})) && result.length)
{
values[i] = result[0] ? result[0] : {
id: v,
label: v
};
}
else
{
if (typeof values[i].id == 'undefined')