Fix the annotationEditorMode
-compatibility for older browsers (PR 15113 follow-up)
This commit is contained in:
parent
ce63663282
commit
63f2d0bb64
@ -39,9 +39,10 @@ if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) {
|
|||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
// Support: Safari<13.1
|
||||||
(function checkResizeObserver() {
|
(function checkResizeObserver() {
|
||||||
if (typeof ResizeObserver === "undefined") {
|
if (typeof ResizeObserver === "undefined") {
|
||||||
compatibilityParams.annotationEditorEnabled = false;
|
compatibilityParams.annotationEditorMode = -1;
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
}
|
}
|
||||||
|
@ -67,6 +67,7 @@ import {
|
|||||||
} from "./ui_utils.js";
|
} from "./ui_utils.js";
|
||||||
import { AnnotationEditorLayerBuilder } from "./annotation_editor_layer_builder.js";
|
import { AnnotationEditorLayerBuilder } from "./annotation_editor_layer_builder.js";
|
||||||
import { AnnotationLayerBuilder } from "./annotation_layer_builder.js";
|
import { AnnotationLayerBuilder } from "./annotation_layer_builder.js";
|
||||||
|
import { compatibilityParams } from "./app_options.js";
|
||||||
import { NullL10n } from "./l10n_utils.js";
|
import { NullL10n } from "./l10n_utils.js";
|
||||||
import { PDFPageView } from "./pdf_page_view.js";
|
import { PDFPageView } from "./pdf_page_view.js";
|
||||||
import { PDFRenderingQueue } from "./pdf_rendering_queue.js";
|
import { PDFRenderingQueue } from "./pdf_rendering_queue.js";
|
||||||
@ -85,6 +86,9 @@ const PagesCountLimit = {
|
|||||||
PAUSE_EAGER_PAGE_INIT: 250,
|
PAUSE_EAGER_PAGE_INIT: 250,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const ANNOTATION_EDITOR_MODE =
|
||||||
|
compatibilityParams.annotationEditorMode ?? AnnotationEditorType.DISABLE;
|
||||||
|
|
||||||
function isValidAnnotationEditorMode(mode) {
|
function isValidAnnotationEditorMode(mode) {
|
||||||
return (
|
return (
|
||||||
Object.values(AnnotationEditorType).includes(mode) &&
|
Object.values(AnnotationEditorType).includes(mode) &&
|
||||||
@ -278,7 +282,7 @@ class BaseViewer {
|
|||||||
this.#annotationMode =
|
this.#annotationMode =
|
||||||
options.annotationMode ?? AnnotationMode.ENABLE_FORMS;
|
options.annotationMode ?? AnnotationMode.ENABLE_FORMS;
|
||||||
this.#annotationEditorMode =
|
this.#annotationEditorMode =
|
||||||
options.annotationEditorMode ?? AnnotationEditorType.DISABLE;
|
options.annotationEditorMode ?? ANNOTATION_EDITOR_MODE;
|
||||||
this.imageResourcesPath = options.imageResourcesPath || "";
|
this.imageResourcesPath = options.imageResourcesPath || "";
|
||||||
this.enablePrintAutoRotate = options.enablePrintAutoRotate || false;
|
this.enablePrintAutoRotate = options.enablePrintAutoRotate || false;
|
||||||
this.renderer = options.renderer || RendererType.CANVAS;
|
this.renderer = options.renderer || RendererType.CANVAS;
|
||||||
|
Loading…
Reference in New Issue
Block a user