mirror of
https://github.com/nasa/openmct.git
synced 2025-06-03 16:10:54 +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>
|
<slot></slot>
|
||||||
<div
|
<div
|
||||||
class="c-frame__move-bar"
|
class="c-frame__move-bar"
|
||||||
@mousedown="isEditing ? startMove([1,1], [0,0], $event) : null"
|
@mousedown.left="startMove($event)"
|
||||||
></div>
|
></div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -93,7 +93,11 @@ export default {
|
|||||||
return value - this.initialPosition[index];
|
return value - this.initialPosition[index];
|
||||||
}.bind(this));
|
}.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('mousemove', this.continueMove);
|
||||||
document.body.addEventListener('mouseup', this.endMove);
|
document.body.addEventListener('mouseup', this.endMove);
|
||||||
this.dragPosition = {
|
this.dragPosition = {
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
|
|
||||||
<div
|
<div
|
||||||
class="c-frame__move-bar"
|
class="c-frame__move-bar"
|
||||||
@mousedown="startDrag($event)"
|
@mousedown.left="startDrag($event)"
|
||||||
></div>
|
></div>
|
||||||
<div
|
<div
|
||||||
v-if="showFrameEdit"
|
v-if="showFrameEdit"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user