mirror of
https://github.com/nasa/openmct.git
synced 2025-05-02 00:39:58 +00:00
[Navigation Tree] Whole tree item clickable (#3632)
* passing click and context click on tree item down to object label, making the whole tree item interactive * removed unnecessary code
This commit is contained in:
parent
2f8431905f
commit
e6e07cf959
@ -42,6 +42,10 @@ export default {
|
||||
navigateToPath: {
|
||||
type: String,
|
||||
default: undefined
|
||||
},
|
||||
propagate: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@ -80,6 +84,10 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
navigateOrPreview(event) {
|
||||
if (!this.propagate) {
|
||||
event.stopPropagation();
|
||||
}
|
||||
|
||||
if (this.openmct.editor.isEditing()) {
|
||||
event.preventDefault();
|
||||
this.preview();
|
||||
|
@ -6,6 +6,8 @@
|
||||
'position': virtualScroll ? 'absolute' : 'relative'
|
||||
}"
|
||||
class="c-tree__item-h"
|
||||
@click="handleClick"
|
||||
@contextmenu="handleContextMenu"
|
||||
>
|
||||
<div
|
||||
class="c-tree__item"
|
||||
@ -20,9 +22,11 @@
|
||||
class="c-tree__item__view-control"
|
||||
:control-class="'c-nav__up'"
|
||||
:enabled="showUp"
|
||||
:propagate="false"
|
||||
@input="resetTreeHere"
|
||||
/>
|
||||
<object-label
|
||||
ref="objectLabel"
|
||||
:domain-object="node.object"
|
||||
:object-path="node.objectPath"
|
||||
:navigate-to-path="navigationPath"
|
||||
@ -34,6 +38,7 @@
|
||||
class="c-tree__item__view-control"
|
||||
:control-class="'c-nav__down'"
|
||||
:enabled="hasComposition && showDown"
|
||||
:propagate="false"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@ -137,6 +142,13 @@ export default {
|
||||
this.openmct.router.off('change:path', this.highlightIfNavigated);
|
||||
},
|
||||
methods: {
|
||||
handleClick(event) {
|
||||
this.$refs.objectLabel.$el.click();
|
||||
},
|
||||
handleContextMenu(event) {
|
||||
this.$refs.objectLabel.showContextMenu(event);
|
||||
event.stopPropagation();
|
||||
},
|
||||
isNavigated() {
|
||||
return this.navigationPath === this.openmct.router.currentLocation.path;
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user