[Editor] Allow to change a preference from the editor UI manager
We want to be able to update a global pref (i.e. enableAltText) in using a toggle button in the new alt-text dialog.
This commit is contained in:
parent
5be66580e6
commit
5946d20dc9
@ -928,6 +928,14 @@ class AnnotationEditorUIManager {
|
||||
});
|
||||
}
|
||||
|
||||
setPreference(name, value) {
|
||||
this._eventBus.dispatch("setpreference", {
|
||||
source: this,
|
||||
name,
|
||||
value,
|
||||
});
|
||||
}
|
||||
|
||||
onPageChanging({ pageNumber }) {
|
||||
this.#currentPageIndex = pageNumber - 1;
|
||||
}
|
||||
|
||||
@ -1942,6 +1942,7 @@ const PDFViewerApplication = {
|
||||
{ signal }
|
||||
);
|
||||
eventBus._on("reporttelemetry", webViewerReportTelemetry, { signal });
|
||||
eventBus._on("setpreference", webViewerSetPreference, { signal });
|
||||
}
|
||||
},
|
||||
|
||||
@ -3166,4 +3167,8 @@ function webViewerReportTelemetry({ details }) {
|
||||
PDFViewerApplication.externalServices.reportTelemetry(details);
|
||||
}
|
||||
|
||||
function webViewerSetPreference({ name, value }) {
|
||||
PDFViewerApplication.preferences.set(name, value);
|
||||
}
|
||||
|
||||
export { PDFViewerApplication };
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user