[Editing] Disable buttons until the first page is rendered
This commit is contained in:
parent
589f72e325
commit
fbce8786d0
@ -727,12 +727,6 @@ class BaseViewer {
|
|||||||
if (isPureXfa) {
|
if (isPureXfa) {
|
||||||
console.warn("Warning: XFA-editing is not implemented.");
|
console.warn("Warning: XFA-editing is not implemented.");
|
||||||
} else if (isValidAnnotationEditorMode(mode)) {
|
} else if (isValidAnnotationEditorMode(mode)) {
|
||||||
// Ensure that the Editor buttons, in the toolbar, are updated.
|
|
||||||
this.eventBus.dispatch("annotationeditormodechanged", {
|
|
||||||
source: this,
|
|
||||||
mode,
|
|
||||||
});
|
|
||||||
|
|
||||||
this.#annotationEditorUIManager = new AnnotationEditorUIManager(
|
this.#annotationEditorUIManager = new AnnotationEditorUIManager(
|
||||||
this.container,
|
this.container,
|
||||||
this.eventBus
|
this.eventBus
|
||||||
@ -817,6 +811,14 @@ class BaseViewer {
|
|||||||
this._scriptingManager.setDocument(pdfDocument); // Enable scripting.
|
this._scriptingManager.setDocument(pdfDocument); // Enable scripting.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.#annotationEditorUIManager) {
|
||||||
|
// Ensure that the Editor buttons, in the toolbar, are updated.
|
||||||
|
this.eventBus.dispatch("annotationeditormodechanged", {
|
||||||
|
source: this,
|
||||||
|
mode: this.#annotationEditorMode,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// In addition to 'disableAutoFetch' being set, also attempt to reduce
|
// In addition to 'disableAutoFetch' being set, also attempt to reduce
|
||||||
// resource usage when loading *very* long/large documents.
|
// resource usage when loading *very* long/large documents.
|
||||||
if (
|
if (
|
||||||
|
@ -244,7 +244,6 @@ class Toolbar {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
this.eventBus._on("annotationeditormodechanged", editorModeChanged);
|
this.eventBus._on("annotationeditormodechanged", editorModeChanged);
|
||||||
|
|
||||||
this.eventBus._on("toolbarreset", evt => {
|
this.eventBus._on("toolbarreset", evt => {
|
||||||
if (evt.source === this) {
|
if (evt.source === this) {
|
||||||
editorModeChanged(
|
editorModeChanged(
|
||||||
|
Loading…
Reference in New Issue
Block a user