Merge pull request #15118 from calixteman/editor_selection
[Editor] Allow to select a freetext editor when in ink mode
This commit is contained in:
commit
a520fc9d9a
@ -95,6 +95,15 @@ class AnnotationEditorLayer {
|
||||
this.#uiManager.addLayer(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the toolbar if it's required to reflect the tool currently used.
|
||||
* @param {number} mode
|
||||
* @returns {undefined}
|
||||
*/
|
||||
updateToolbar(mode) {
|
||||
this.#uiManager.updateToolbar(mode);
|
||||
}
|
||||
|
||||
/**
|
||||
* The mode has changed: it must be updated.
|
||||
* @param {number} mode
|
||||
|
@ -209,6 +209,7 @@ class FreeTextEditor extends AnnotationEditor {
|
||||
|
||||
/** @inheritdoc */
|
||||
enableEditMode() {
|
||||
this.parent.updateToolbar(AnnotationEditorType.FREETEXT);
|
||||
super.enableEditMode();
|
||||
this.overlayDiv.classList.remove("enabled");
|
||||
this.editorDiv.contentEditable = true;
|
||||
|
@ -319,7 +319,7 @@ class AnnotationEditorUIManager {
|
||||
}
|
||||
|
||||
#dispatchUpdateUI(details) {
|
||||
this.#eventBus?.dispatch("annotationeditorparamschanged", {
|
||||
this.#eventBus.dispatch("annotationeditorparamschanged", {
|
||||
source: this,
|
||||
details,
|
||||
});
|
||||
@ -377,6 +377,21 @@ class AnnotationEditorUIManager {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the toolbar if it's required to reflect the tool currently used.
|
||||
* @param {number} mode
|
||||
* @returns {undefined}
|
||||
*/
|
||||
updateToolbar(mode) {
|
||||
if (mode === this.#mode) {
|
||||
return;
|
||||
}
|
||||
this.#eventBus.dispatch("switchannotationeditormode", {
|
||||
source: this,
|
||||
mode,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Update a parameter in the current editor or globally.
|
||||
* @param {number} type
|
||||
|
@ -47,6 +47,7 @@
|
||||
resize: none;
|
||||
width: auto;
|
||||
height: auto;
|
||||
z-index: 1;
|
||||
transform-origin: 0 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user