mirror of
https://github.com/nasa/openmct.git
synced 2025-01-31 08:25:31 +00:00
Tracking navigation requests, if multiple, only finish on latest (#3403)
This commit is contained in:
parent
db33f0538a
commit
5f7e34ce6c
@ -193,10 +193,6 @@ export default {
|
|||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
syncTreeNavigation() {
|
syncTreeNavigation() {
|
||||||
if (this.isLoading) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const AND_SAVE_PATH = true;
|
const AND_SAVE_PATH = true;
|
||||||
let currentLocationPath = this.openmct.router.currentLocation.path;
|
let currentLocationPath = this.openmct.router.currentLocation.path;
|
||||||
let hasParent = this.currentlyViewedObjectParentPath() || (this.multipleRootChildren && !this.currentlyViewedObjectParentPath());
|
let hasParent = this.currentlyViewedObjectParentPath() || (this.multipleRootChildren && !this.currentlyViewedObjectParentPath());
|
||||||
@ -441,6 +437,9 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
async getAllChildren(node) {
|
async getAllChildren(node) {
|
||||||
|
let currentNavigationRequest = this.openmct.objects.makeKeyString(node.object.identifier);
|
||||||
|
this.latestNavigationRequest = currentNavigationRequest;
|
||||||
|
|
||||||
await this.clearVisibleItems();
|
await this.clearVisibleItems();
|
||||||
this.isLoading = true;
|
this.isLoading = true;
|
||||||
|
|
||||||
@ -455,7 +454,10 @@ export default {
|
|||||||
this.composition.on('add', this.addChild);
|
this.composition.on('add', this.addChild);
|
||||||
this.composition.on('remove', this.removeChild);
|
this.composition.on('remove', this.removeChild);
|
||||||
await this.composition.load();
|
await this.composition.load();
|
||||||
this.finishLoading();
|
|
||||||
|
if (currentNavigationRequest === this.latestNavigationRequest) {
|
||||||
|
this.finishLoading();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
buildTreeItem(domainObject) {
|
buildTreeItem(domainObject) {
|
||||||
let navToParent = ROOT_PATH + this.currentNavigatedPath;
|
let navToParent = ROOT_PATH + this.currentNavigatedPath;
|
||||||
@ -636,20 +638,12 @@ export default {
|
|||||||
this.setContainerHeight();
|
this.setContainerHeight();
|
||||||
},
|
},
|
||||||
handleReset(node) {
|
handleReset(node) {
|
||||||
if (this.isLoading) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.childrenSlideClass = 'up';
|
this.childrenSlideClass = 'up';
|
||||||
this.ancestors.splice(this.ancestors.indexOf(node) + 1);
|
this.ancestors.splice(this.ancestors.indexOf(node) + 1);
|
||||||
this.getAllChildren(node);
|
this.getAllChildren(node);
|
||||||
this.setCurrentNavigatedPath();
|
this.setCurrentNavigatedPath();
|
||||||
},
|
},
|
||||||
handleExpanded(node) {
|
handleExpanded(node) {
|
||||||
if (this.activeSearch || this.isLoading) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.childrenSlideClass = 'down';
|
this.childrenSlideClass = 'down';
|
||||||
let newParent = this.buildTreeItem(node);
|
let newParent = this.buildTreeItem(node);
|
||||||
this.ancestors.push(newParent);
|
this.ancestors.push(newParent);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user