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 // Check options
(result = $j.grep(this.options.select_options, function(e) { (result = $j.grep(this.options.select_options, function(e) {
return e.id == v; return e.id == v;
})) || })) && result.length
// Check current selection to avoid going back to server
(result = $j.grep(this.taglist.getSelection(), function(e) {
return e.id == v;
}))
) )
{ {
// Options should have been provided, but they weren't // 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 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 else
{ {
if (typeof values[i].id == 'undefined') if (typeof values[i].id == 'undefined')