mirror of
https://github.com/webmin/webmin.git
synced 2026-02-03 06:03:28 +00:00
Fix to truly move option tag rather than recreating
*Note: It keep existing styles and using index from "add()" will also put moved options to the top of the select and make them clearly visible
This commit is contained in:
10
ui-lib.pl
10
ui-lib.pl
@@ -1108,9 +1108,8 @@ if (dir == 1 && opts_idx >= 0) {
|
||||
for(var i=0; i<opts.options.length; i++) {
|
||||
var o = opts.options[i];
|
||||
if (o.selected) {
|
||||
vals.options[vals.options.length] =
|
||||
new Option(o.text, o.value);
|
||||
opts.remove(i);
|
||||
o.selected = false;
|
||||
vals.add(o, 0);
|
||||
i--;
|
||||
}
|
||||
}
|
||||
@@ -1120,9 +1119,8 @@ else if (dir == 0 && vals_idx >= 0) {
|
||||
for(var i=0; i<vals.options.length; i++) {
|
||||
var o = vals.options[i];
|
||||
if (o.selected) {
|
||||
opts.options[opts.options.length] =
|
||||
new Option(o.text, o.value);
|
||||
vals.remove(i);
|
||||
o.selected = false;
|
||||
opts.add(o, 0);
|
||||
i--;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user