[GENERIC viewer] Ensure that the we register the editorTypes
for each AnnotationEditorUIManager
-instance (issue 15564)
When a new PDF document is opened in the GENERIC viewer we (obviously) create a new `AnnotationEditorUIManager`-instance, since those are document-specific, and thus we need to ensure that we actually register the `editorTypes` for each one.
This commit is contained in:
parent
21c2d0c7b0
commit
00c3bc3aab
@ -69,9 +69,9 @@ class AnnotationEditorLayer {
|
|||||||
AnnotationEditorLayer._initialized = true;
|
AnnotationEditorLayer._initialized = true;
|
||||||
FreeTextEditor.initialize(options.l10n);
|
FreeTextEditor.initialize(options.l10n);
|
||||||
InkEditor.initialize(options.l10n);
|
InkEditor.initialize(options.l10n);
|
||||||
|
|
||||||
options.uiManager.registerEditorTypes([FreeTextEditor, InkEditor]);
|
|
||||||
}
|
}
|
||||||
|
options.uiManager.registerEditorTypes([FreeTextEditor, InkEditor]);
|
||||||
|
|
||||||
this.#uiManager = options.uiManager;
|
this.#uiManager = options.uiManager;
|
||||||
this.annotationStorage = options.annotationStorage;
|
this.annotationStorage = options.annotationStorage;
|
||||||
this.pageIndex = options.pageIndex;
|
this.pageIndex = options.pageIndex;
|
||||||
|
@ -637,6 +637,9 @@ class AnnotationEditorUIManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
registerEditorTypes(types) {
|
registerEditorTypes(types) {
|
||||||
|
if (this.#editorTypes) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.#editorTypes = types;
|
this.#editorTypes = types;
|
||||||
for (const editorType of this.#editorTypes) {
|
for (const editorType of this.#editorTypes) {
|
||||||
this.#dispatchUpdateUI(editorType.defaultPropertiesToUpdate);
|
this.#dispatchUpdateUI(editorType.defaultPropertiesToUpdate);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user