mirror of
https://github.com/nasa/openmct.git
synced 2025-02-27 19:46:54 +00:00
block nav when "syncing" tree only, where most of the problems popped up (#3451)
This commit is contained in:
parent
c756adad6f
commit
7f10681424
@ -49,7 +49,7 @@
|
|||||||
/>
|
/>
|
||||||
<!-- loading -->
|
<!-- loading -->
|
||||||
<div
|
<div
|
||||||
v-if="isLoading || !itemHeightCalculated"
|
v-if="isLoading || !itemHeightCalculated || syncingNavigation"
|
||||||
:style="indicatorLeftOffset"
|
:style="indicatorLeftOffset"
|
||||||
class="c-tree__item c-tree-and-search__loading loading"
|
class="c-tree__item c-tree-and-search__loading loading"
|
||||||
>
|
>
|
||||||
@ -88,7 +88,7 @@
|
|||||||
@expanded="handleExpanded"
|
@expanded="handleExpanded"
|
||||||
/>
|
/>
|
||||||
<li
|
<li
|
||||||
v-if="visibleItems.length === 0 && !noVisibleItems && !activeSearch"
|
v-if="visibleItems.length === 0 && !noVisibleItems && !activeSearch && !syncingNavigation"
|
||||||
:style="indicatorLeftOffset"
|
:style="indicatorLeftOffset"
|
||||||
class="c-tree__item c-tree__item--empty"
|
class="c-tree__item c-tree__item--empty"
|
||||||
>
|
>
|
||||||
@ -206,12 +206,21 @@ export default {
|
|||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
syncTreeNavigation() {
|
syncTreeNavigation() {
|
||||||
|
if (this.syncingNavigation) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const AND_SAVE_PATH = true;
|
const AND_SAVE_PATH = true;
|
||||||
|
this.syncingNavigation = 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());
|
||||||
|
// if there's a current location path,
|
||||||
|
// if there's a parent of the currently viewed object
|
||||||
|
// and we're not in the parent of the currently viewed object
|
||||||
let jumpAndScroll = currentLocationPath
|
let jumpAndScroll = currentLocationPath
|
||||||
&& hasParent
|
&& hasParent
|
||||||
&& !this.currentPathIsActivePath();
|
&& !this.currentPathIsActivePath();
|
||||||
|
// if the object being viewed is in the current path
|
||||||
let justScroll = this.currentPathIsActivePath();
|
let justScroll = this.currentPathIsActivePath();
|
||||||
|
|
||||||
if (this.searchValue) {
|
if (this.searchValue) {
|
||||||
@ -219,9 +228,10 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (jumpAndScroll) {
|
if (jumpAndScroll) {
|
||||||
this.scrollTo = this.currentlyViewedObjectId();
|
|
||||||
this.allTreeItems = [];
|
this.allTreeItems = [];
|
||||||
|
this.scrollTo = this.currentlyViewedObjectId();
|
||||||
this.jumpPath = this.currentlyViewedObjectParentPath();
|
this.jumpPath = this.currentlyViewedObjectParentPath();
|
||||||
|
|
||||||
if (this.multipleRootChildren) {
|
if (this.multipleRootChildren) {
|
||||||
if (!this.jumpPath) {
|
if (!this.jumpPath) {
|
||||||
this.jumpPath = 'ROOT';
|
this.jumpPath = 'ROOT';
|
||||||
@ -237,6 +247,7 @@ export default {
|
|||||||
} else if (justScroll) {
|
} else if (justScroll) {
|
||||||
this.scrollTo = this.currentlyViewedObjectId();
|
this.scrollTo = this.currentlyViewedObjectId();
|
||||||
this.autoScroll();
|
this.autoScroll();
|
||||||
|
this.syncingNavigation = false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
searchValue() {
|
searchValue() {
|
||||||
@ -524,6 +535,7 @@ export default {
|
|||||||
|
|
||||||
this.autoScroll();
|
this.autoScroll();
|
||||||
this.isLoading = false;
|
this.isLoading = false;
|
||||||
|
this.syncingNavigation = false;
|
||||||
this.setContainerHeight();
|
this.setContainerHeight();
|
||||||
},
|
},
|
||||||
async jumpToPath(saveExpandedPath = false) {
|
async jumpToPath(saveExpandedPath = false) {
|
||||||
@ -629,6 +641,10 @@ export default {
|
|||||||
this.$refs.scrollable.scrollTop = 0;
|
this.$refs.scrollable.scrollTop = 0;
|
||||||
},
|
},
|
||||||
handleReset(node) {
|
handleReset(node) {
|
||||||
|
if (this.syncingNavigation) {
|
||||||
|
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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user