Issue 2472 Disable selection in layouts when previewing (#2530)

* ISSUE-2472: disable selection in layouts during preview
This commit is contained in:
David Tsay 2019-11-05 16:20:26 -08:00 committed by Deep Tailor
parent fab8bb516a
commit 286d6e5082
2 changed files with 20 additions and 1 deletions

View File

@ -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);

View File

@ -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">