mirror of
https://github.com/nasa/openmct.git
synced 2025-06-21 08:39:59 +00:00
Reorder api update (#2319)
* Added 'reorder' function to composition API * Re-implemented reordering in Elements * Make LAD table editable * Remove test spec focus * Fixing bugs with event listeners * Clean up listeners properly in Elements pool * Fixed race condition on drag-and-drop to initiate edit * Implement reordering in LAD tables * Reorder events emit full reorder plan * Fixed failing specs
This commit is contained in:
committed by
Deep Tailor
parent
a14f628ca3
commit
019d108bb2
@ -66,10 +66,11 @@ export default {
|
||||
|
||||
this.items.splice(index, 1);
|
||||
},
|
||||
reorder(oldIndex, newIndex) {
|
||||
let objectAtOldIndex = this.items[oldIndex];
|
||||
this.$set(this.items, oldIndex, this.items[newIndex]);
|
||||
this.$set(this.items, newIndex, objectAtOldIndex);
|
||||
reorder(reorderPlan) {
|
||||
let oldItems = this.items.slice();
|
||||
reorderPlan.forEach((reorderEvent) => {
|
||||
this.$set(this.items, reorderEvent.newIndex, oldItems[reorderEvent.oldIndex]);
|
||||
});
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
@ -93,11 +93,11 @@
|
||||
this.primaryTelemetryObjects.splice(index,1);
|
||||
primary = undefined;
|
||||
},
|
||||
reorderPrimary(oldIndex, newIndex) {
|
||||
let objectAtOldIndex = this.primaryTelemetryObjects[oldIndex];
|
||||
this.$set(this.primaryTelemetryObjects, oldIndex, this.primaryTelemetryObjects[newIndex]);
|
||||
this.$set(this.primaryTelemetryObjects, newIndex, objectAtOldIndex);
|
||||
|
||||
reorderPrimary(reorderPlan) {
|
||||
let oldComposition = this.primaryTelemetryObjects.slice();
|
||||
reorderPlan.forEach(reorderEvent => {
|
||||
this.$set(this.primaryTelemetryObjects, reorderEvent.newIndex, oldComposition[reorderEvent.oldIndex]);
|
||||
});
|
||||
},
|
||||
addSecondary(primary) {
|
||||
return (domainObject) => {
|
||||
|
Reference in New Issue
Block a user