Merge pull request #16825 from calixteman/editor_avoid_right_click
[Editor] Avoid showing the context menu or resizing when a resizer is right clicked
This commit is contained in:
commit
1d523d3ec1
@ -460,6 +460,10 @@ class AnnotationEditor {
|
||||
return [0, 0];
|
||||
}
|
||||
|
||||
static #noContextMenu(e) {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
#createResizers() {
|
||||
if (this.#resizersDiv) {
|
||||
return;
|
||||
@ -478,12 +482,18 @@ class AnnotationEditor {
|
||||
"pointerdown",
|
||||
this.#resizerPointerdown.bind(this, name)
|
||||
);
|
||||
div.addEventListener("contextmenu", AnnotationEditor.#noContextMenu);
|
||||
}
|
||||
this.div.prepend(this.#resizersDiv);
|
||||
}
|
||||
|
||||
#resizerPointerdown(name, event) {
|
||||
event.preventDefault();
|
||||
const { isMac } = FeatureTest.platform;
|
||||
if (event.button !== 0 || (event.ctrlKey && isMac)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const boundResizerPointermove = this.#resizerPointermove.bind(this, name);
|
||||
const savedDraggable = this._isDraggable;
|
||||
this._isDraggable = false;
|
||||
|
Loading…
Reference in New Issue
Block a user