Bug 68921 - Debug change-columns

git-svn-id: svn://svn.office.custis.ru/3rdparty/bugzilla.org/trunk@949 6955db30-a419-402b-8a0d-67ecbb4d7f56
master
vfilippov 2010-09-30 13:04:13 +00:00
parent 8e30de0833
commit ad6c3e520c
1 changed files with 20 additions and 13 deletions

View File

@ -28,17 +28,24 @@ function initChangeColumns() {
updateView(); updateView();
} }
function switch_options(from_box, to_box, selected) { function switch_options(from_box, to_box, selected)
for (var i = 0; i<from_box.options.length; i++) { {
var sel = [];
for (var i = 0; i < from_box.options.length; i++)
sel[i] = from_box.options[i].selected;
var newlist = [];
for (var i = from_box.options.length-1; i >= 0; i--)
{
if (sel[i] == selected)
{
var opt = from_box.options[i]; var opt = from_box.options[i];
if (opt.selected == selected) { var newopt = new Option(opt.text, opt.value, opt.defaultselected, sel[i]);
var newopt = new Option(opt.text, opt.value, opt.defaultselected, opt.selected); newlist.unshift(newopt);
to_box.options[to_box.options.length] = newopt; from_box.options.remove(i);
from_box.options[i] = null;
i = i - 1;
} }
} }
for (var i in newlist)
to_box.options.add(newlist[i]);
} }
function move_select() { function move_select() {