Merge branch 'master' into object-create-fix-9152020

This commit is contained in:
Deep Tailor 2020-09-15 12:54:11 -07:00 committed by GitHub
commit 56c203d9ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -41,6 +41,7 @@
<!-- loading -->
<li
v-if="isLoading"
:style="indicatorLeftOffset"
class="c-tree__item c-tree-and-search__loading loading"
>
<span class="c-tree__item__label">Loading...</span>
@ -77,7 +78,7 @@
/>
<li
v-if="visibleItems.length === 0 && !noVisibleItems"
:style="emptyStyles()"
:style="indicatorLeftOffset"
class="c-tree__item c-tree__item--empty"
>
No items
@ -167,10 +168,21 @@ export default {
},
itemLeftOffset() {
return this.activeSearch ? '0px' : this.ancestors.length * 10 + 'px';
},
indicatorLeftOffset() {
let offset = ((this.ancestors.length + 1) * 10);
return {
paddingLeft: offset + 'px'
};
}
},
watch: {
syncTreeNavigation() {
if (this.isLoading) {
return;
}
const AND_SAVE_PATH = true;
let currentLocationPath = this.openmct.router.currentLocation.path;
let hasParent = this.currentlyViewedObjectParentPath() || (this.multipleRootChildren && !this.currentlyViewedObjectParentPath());
@ -292,6 +304,7 @@ export default {
this.itemOffset = start;
this.visibleItems = this.focusedItems.slice(start, end);
this.noVisibleItems = false;
this.updatingView = false;
});
@ -319,7 +332,6 @@ export default {
this.noScroll = true;
}
this.noVisibleItems = false;
this.updatevisibleItems();
});
} else {
@ -408,7 +420,9 @@ export default {
}
},
async getAllChildren(node) {
await this.clearVisibleItems();
this.isLoading = true;
if (this.composition) {
this.composition.off('add', this.addChild);
this.composition.off('remove', this.removeChild);
@ -554,22 +568,21 @@ export default {
this.$refs.scrollable.scrollTop = 0;
this.setContainerHeight();
},
async handleReset(node) {
this.visibleItems = [];
await this.$nextTick(); // prevents "ghost" image of visibleItems
handleReset(node) {
if (this.isLoading) {
return;
}
this.childrenSlideClass = 'slide-right';
this.ancestors.splice(this.ancestors.indexOf(node) + 1);
this.getAllChildren(node);
this.setCurrentNavigatedPath();
},
async handleExpanded(node) {
if (this.activeSearch) {
handleExpanded(node) {
if (this.activeSearch || this.isLoading) {
return;
}
this.noVisibleItems = true;
this.visibleItems = [];
await this.$nextTick(); // prevents "ghost" image of visibleItems
this.childrenSlideClass = 'slide-left';
let newParent = this.buildTreeItem(node);
this.ancestors.push(newParent);
@ -605,6 +618,13 @@ export default {
return currentPath.join('/');
}
},
async clearVisibleItems() {
this.noVisibleItems = true;
this.visibleItems = [];
await this.$nextTick(); // prevents "ghost" image of visibleItems
return;
},
scrollItems(event) {
if (!windowResizing) {
this.updatevisibleItems();
@ -619,13 +639,6 @@ export default {
overflow: this.noScroll ? 'hidden' : 'scroll'
};
},
emptyStyles() {
let offset = ((this.ancestors.length + 1) * 10);
return {
paddingLeft: offset + 'px'
};
},
childrenIn(el, done) {
// still needing this timeout for some reason
window.setTimeout(this.setContainerHeight, RECHECK_DELAY);