organized the metacodes list
This commit is contained in:
parent
7e6294a705
commit
8305beaaa7
1 changed files with 13 additions and 2 deletions
|
@ -581,12 +581,23 @@ function onCreateLabelHandler(domElement, node) {
|
|||
</div>';
|
||||
|
||||
//create metacode_choices array from imgArray
|
||||
var metacode_choices = "'[";
|
||||
var metacodes = new Array();
|
||||
for (var key in imgArray) {
|
||||
if (imgArray.hasOwnProperty(key)) {
|
||||
metacode_choices += '["' + key + '","' + key + '"],';
|
||||
if (key != node.getData("metacode")) {
|
||||
metacodes.push(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Arrange it how we want it
|
||||
metacodes.sort();
|
||||
metacodes.unshift(node.getData("metacode"));
|
||||
|
||||
var metacode_choices = "'[";
|
||||
for (var i in metacodes) {
|
||||
metacode_choices += '["' + metacodes[i] + '","' + metacodes[i] + '"],';
|
||||
}
|
||||
//remove trailing comma and add ]
|
||||
metacode_choices = metacode_choices.slice(0, -1);
|
||||
metacode_choices += "]'";
|
||||
|
|
Loading…
Reference in a new issue