mirror of
https://github.com/nasa/openmct.git
synced 2025-04-07 19:34:25 +00:00
[Display Layout] Right click on item acts as sticky move (#4126)
* Added a left click filter to the mousedown events * Moved ternary logic out of the template * Move defauts into function params
This commit is contained in:
parent
62de310686
commit
f2b2953a5d
@ -33,7 +33,7 @@
|
||||
<slot></slot>
|
||||
<div
|
||||
class="c-frame__move-bar"
|
||||
@mousedown="isEditing ? startMove([1,1], [0,0], $event) : null"
|
||||
@mousedown.left="startMove($event)"
|
||||
></div>
|
||||
</div>
|
||||
</template>
|
||||
@ -93,7 +93,11 @@ export default {
|
||||
return value - this.initialPosition[index];
|
||||
}.bind(this));
|
||||
},
|
||||
startMove(posFactor, dimFactor, event) {
|
||||
startMove(event, posFactor = [1, 1], dimFactor = [0, 0]) {
|
||||
if (!this.isEditing) {
|
||||
return;
|
||||
}
|
||||
|
||||
document.body.addEventListener('mousemove', this.continueMove);
|
||||
document.body.addEventListener('mouseup', this.endMove);
|
||||
this.dragPosition = {
|
||||
|
@ -45,7 +45,7 @@
|
||||
|
||||
<div
|
||||
class="c-frame__move-bar"
|
||||
@mousedown="startDrag($event)"
|
||||
@mousedown.left="startDrag($event)"
|
||||
></div>
|
||||
<div
|
||||
v-if="showFrameEdit"
|
||||
|
Loading…
x
Reference in New Issue
Block a user