mirror of
https://github.com/nasa/openmct.git
synced 2024-12-23 15:02:23 +00:00
Issue 2472 Disable selection in layouts when previewing (#2530)
* ISSUE-2472: disable selection in layouts during preview
This commit is contained in:
parent
fab8bb516a
commit
286d6e5082
@ -166,6 +166,17 @@ define(
|
||||
return this.selected.some(selectionPath => _.isEqual(selectionPath[1], selectable[1]));
|
||||
};
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
Selection.prototype.isSelectable = function (element) {
|
||||
if (!element) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return !!element.closest('[data-selectable]');
|
||||
};
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
@ -211,8 +222,14 @@ define(
|
||||
context: context,
|
||||
element: element
|
||||
};
|
||||
|
||||
if (!this.isSelectable(element)) {
|
||||
return () => {};
|
||||
}
|
||||
|
||||
var capture = this.capture.bind(this, selectable);
|
||||
var selectCapture = this.selectCapture.bind(this, selectable);
|
||||
|
||||
element.addEventListener('click', capture, true);
|
||||
element.addEventListener('click', selectCapture);
|
||||
|
||||
|
@ -39,7 +39,9 @@
|
||||
<toolbar v-if="toolbar" class="l-shell__toolbar"></toolbar>
|
||||
<object-view class="l-shell__main-container"
|
||||
ref="browseObject"
|
||||
:showEditView="true">
|
||||
:showEditView="true"
|
||||
data-selectable
|
||||
>
|
||||
</object-view>
|
||||
<component class="l-shell__time-conductor"
|
||||
:is="conductorComponent">
|
||||
|
Loading…
Reference in New Issue
Block a user