Merge pull request #18605 from Snuffleupagus/issue-18196
Handle the "switchannotationeditorparams" event in the editor-code (issue 18196)
This commit is contained in:
commit
8446d3ac03
@ -776,21 +776,18 @@ class AnnotationEditorUIManager {
|
|||||||
this.#viewer = viewer;
|
this.#viewer = viewer;
|
||||||
this.#altTextManager = altTextManager;
|
this.#altTextManager = altTextManager;
|
||||||
this._eventBus = eventBus;
|
this._eventBus = eventBus;
|
||||||
this._eventBus._on("editingaction", this.onEditingAction.bind(this), {
|
eventBus._on("editingaction", this.onEditingAction.bind(this), { signal });
|
||||||
signal,
|
eventBus._on("pagechanging", this.onPageChanging.bind(this), { signal });
|
||||||
});
|
eventBus._on("scalechanging", this.onScaleChanging.bind(this), { signal });
|
||||||
this._eventBus._on("pagechanging", this.onPageChanging.bind(this), {
|
eventBus._on("rotationchanging", this.onRotationChanging.bind(this), {
|
||||||
signal,
|
|
||||||
});
|
|
||||||
this._eventBus._on("scalechanging", this.onScaleChanging.bind(this), {
|
|
||||||
signal,
|
|
||||||
});
|
|
||||||
this._eventBus._on("rotationchanging", this.onRotationChanging.bind(this), {
|
|
||||||
signal,
|
|
||||||
});
|
|
||||||
this._eventBus._on("setpreference", this.onSetPreference.bind(this), {
|
|
||||||
signal,
|
signal,
|
||||||
});
|
});
|
||||||
|
eventBus._on("setpreference", this.onSetPreference.bind(this), { signal });
|
||||||
|
eventBus._on(
|
||||||
|
"switchannotationeditorparams",
|
||||||
|
evt => this.updateParams(evt.type, evt.value),
|
||||||
|
{ signal }
|
||||||
|
);
|
||||||
this.#addSelectionListener();
|
this.#addSelectionListener();
|
||||||
this.#addDragAndDropListeners();
|
this.#addDragAndDropListeners();
|
||||||
this.#addKeyboardManager();
|
this.#addKeyboardManager();
|
||||||
|
|||||||
@ -1939,11 +1939,6 @@ const PDFViewerApplication = {
|
|||||||
evt => (pdfViewer.annotationEditorMode = evt),
|
evt => (pdfViewer.annotationEditorMode = evt),
|
||||||
{ signal }
|
{ signal }
|
||||||
);
|
);
|
||||||
eventBus._on(
|
|
||||||
"switchannotationeditorparams",
|
|
||||||
evt => (pdfViewer.annotationEditorParams = evt),
|
|
||||||
{ signal }
|
|
||||||
);
|
|
||||||
eventBus._on("print", this.triggerPrinting.bind(this), { signal });
|
eventBus._on("print", this.triggerPrinting.bind(this), { signal });
|
||||||
eventBus._on("download", this.downloadOrSave.bind(this), { signal });
|
eventBus._on("download", this.downloadOrSave.bind(this), { signal });
|
||||||
eventBus._on("firstpage", () => (this.page = 1), { signal });
|
eventBus._on("firstpage", () => (this.page = 1), { signal });
|
||||||
|
|||||||
@ -2363,14 +2363,6 @@ class PDFViewer {
|
|||||||
updater();
|
updater();
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line accessor-pairs
|
|
||||||
set annotationEditorParams({ type, value }) {
|
|
||||||
if (!this.#annotationEditorUIManager) {
|
|
||||||
throw new Error(`The AnnotationEditor is not enabled.`);
|
|
||||||
}
|
|
||||||
this.#annotationEditorUIManager.updateParams(type, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
refresh(noUpdate = false, updateArgs = Object.create(null)) {
|
refresh(noUpdate = false, updateArgs = Object.create(null)) {
|
||||||
if (!this.pdfDocument) {
|
if (!this.pdfDocument) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user