mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 09:20:06 +02:00
[Editor] Refactor dragging and dropping an editor (bugs 1802895, 1844618)
It'll help to have a full control on what's happening when moving an editor.
This commit is contained in:
parent
0725b6299f
commit
b59b1a81a9
11 changed files with 170 additions and 75 deletions
|
@ -294,7 +294,7 @@ class InkEditor extends AnnotationEditor {
|
|||
}
|
||||
|
||||
super.enableEditMode();
|
||||
this.div.draggable = false;
|
||||
this._isDraggable = false;
|
||||
this.canvas.addEventListener("pointerdown", this.#boundCanvasPointerdown);
|
||||
}
|
||||
|
||||
|
@ -305,7 +305,7 @@ class InkEditor extends AnnotationEditor {
|
|||
}
|
||||
|
||||
super.disableEditMode();
|
||||
this.div.draggable = !this.isEmpty();
|
||||
this._isDraggable = !this.isEmpty();
|
||||
this.div.classList.remove("editing");
|
||||
|
||||
this.canvas.removeEventListener(
|
||||
|
@ -316,7 +316,7 @@ class InkEditor extends AnnotationEditor {
|
|||
|
||||
/** @inheritdoc */
|
||||
onceAdded() {
|
||||
this.div.draggable = !this.isEmpty();
|
||||
this._isDraggable = !this.isEmpty();
|
||||
}
|
||||
|
||||
/** @inheritdoc */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue