mirror of
https://github.com/nasa/openmct.git
synced 2025-02-18 16:40:58 +00:00
Tree Performance Fixes (#2353)
* Disable disclosure triangle transition * Reduce number of times navigation path is calculated
This commit is contained in:
parent
8b275b206b
commit
517a40a32b
@ -148,8 +148,6 @@ button {
|
||||
display: block;
|
||||
font-family: symbolsfont;
|
||||
font-size: 1rem * $s;
|
||||
transform-origin: center;
|
||||
transition: $transOut;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -59,7 +59,8 @@ export default {
|
||||
default() {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
},
|
||||
navigateToPath: String
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
@ -211,7 +211,8 @@
|
||||
return {
|
||||
id: this.openmct.objects.makeKeyString(c.identifier),
|
||||
object: c,
|
||||
objectPath: [c]
|
||||
objectPath: [c],
|
||||
navigateToParent: '/browse'
|
||||
};
|
||||
});
|
||||
});
|
||||
|
@ -7,7 +7,8 @@
|
||||
v-model="expanded">
|
||||
</view-control>
|
||||
<object-label :domainObject="node.object"
|
||||
:objectPath="node.objectPath">
|
||||
:objectPath="node.objectPath"
|
||||
:navigateToPath="navigateToPath">
|
||||
</object-label>
|
||||
</div>
|
||||
<ul v-if="expanded" class="c-tree">
|
||||
@ -36,13 +37,12 @@
|
||||
node: Object
|
||||
},
|
||||
data() {
|
||||
this.pathToObject = this.buildPathString(this.node.objectPath);
|
||||
|
||||
this.navigateToPath = this.buildPathString(this.node.navigateToParent)
|
||||
return {
|
||||
hasChildren: false,
|
||||
isLoading: false,
|
||||
loaded: false,
|
||||
isNavigated: this.pathToObject === this.openmct.router.currentLocation.path,
|
||||
isNavigated: this.navigateToPath === this.openmct.router.currentLocation.path,
|
||||
children: [],
|
||||
expanded: false
|
||||
}
|
||||
@ -103,7 +103,8 @@
|
||||
this.children.push({
|
||||
id: this.openmct.objects.makeKeyString(child.identifier),
|
||||
object: child,
|
||||
objectPath: [child].concat(this.node.objectPath)
|
||||
objectPath: [child].concat(this.node.objectPath),
|
||||
navigateToParent: this.navigateToPath
|
||||
});
|
||||
},
|
||||
removeChild(identifier) {
|
||||
@ -115,15 +116,13 @@
|
||||
this.isLoading = false;
|
||||
this.loaded = true;
|
||||
},
|
||||
buildPathString(path) {
|
||||
return '/browse/' + path.map(o => o && this.openmct.objects.makeKeyString(o.identifier))
|
||||
.reverse()
|
||||
.join('/');
|
||||
buildPathString(parentPath) {
|
||||
return [parentPath, this.openmct.objects.makeKeyString(this.node.object.identifier)].join('/');
|
||||
},
|
||||
highlightIfNavigated(newPath, oldPath){
|
||||
if (newPath === this.pathToObject) {
|
||||
if (newPath === this.navigateToPath) {
|
||||
this.isNavigated = true;
|
||||
} else if (oldPath === this.pathToObject) {
|
||||
} else if (oldPath === this.navigateToPath) {
|
||||
this.isNavigated = false;
|
||||
}
|
||||
}
|
||||
|
@ -13,6 +13,9 @@ export default {
|
||||
if (!this.objectPath.length) {
|
||||
return;
|
||||
}
|
||||
if (this.navigateToPath) {
|
||||
return '#' + this.navigateToPath;
|
||||
}
|
||||
return '#/browse/' + this.objectPath
|
||||
.map(o => o && this.openmct.objects.makeKeyString(o.identifier))
|
||||
.reverse()
|
||||
|
Loading…
x
Reference in New Issue
Block a user