mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-23 17:08:41 -06:00
Fix ordering for rack positioning
This commit is contained in:
parent
d0597cd289
commit
a4690ec5ce
@ -197,7 +197,7 @@ $(document).ready(function() {
|
|||||||
$(element).children('option').attr('disabled', false);
|
$(element).children('option').attr('disabled', false);
|
||||||
var results = data.results;
|
var results = data.results;
|
||||||
|
|
||||||
results = results.reduce((results,record) => {
|
results = results.reduce((results,record,idx) => {
|
||||||
record.text = record[element.getAttribute('display-field')] || record.name;
|
record.text = record[element.getAttribute('display-field')] || record.name;
|
||||||
record.id = record[element.getAttribute('value-field')] || record.id;
|
record.id = record[element.getAttribute('value-field')] || record.id;
|
||||||
if(element.getAttribute('disabled-indicator') && record[element.getAttribute('disabled-indicator')]) {
|
if(element.getAttribute('disabled-indicator') && record[element.getAttribute('disabled-indicator')]) {
|
||||||
@ -222,7 +222,7 @@ $(document).ready(function() {
|
|||||||
results['global'].children.push(record);
|
results['global'].children.push(record);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
results[record.id] = record
|
results[idx] = record
|
||||||
}
|
}
|
||||||
|
|
||||||
return results;
|
return results;
|
||||||
|
Loading…
Reference in New Issue
Block a user