mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 09:20:06 +02:00
[editor] Disable the editor-buttons in XFA documents
Given the differences between XFA documents and "normal" PDF documents, we don't support editing of the former ones. Hence, when a XFA-document is opened, we temporarily disable the editor-buttons.
This commit is contained in:
parent
9b22483e00
commit
d34e7fff01
6 changed files with 37 additions and 15 deletions
|
@ -97,6 +97,8 @@ class Toolbar {
|
|||
next: options.next,
|
||||
zoomIn: options.zoomIn,
|
||||
zoomOut: options.zoomOut,
|
||||
editorNoneButton: options.editorNoneButton,
|
||||
editorFreeTextButton: options.editorFreeTextButton,
|
||||
};
|
||||
|
||||
this._wasLocalized = false;
|
||||
|
@ -133,6 +135,7 @@ class Toolbar {
|
|||
this.pageScale = DEFAULT_SCALE;
|
||||
this._updateUIState(true);
|
||||
this.updateLoadingIndicatorState();
|
||||
this.updateEditorModeButtonsState();
|
||||
}
|
||||
|
||||
_bindListeners(options) {
|
||||
|
@ -267,9 +270,16 @@ class Toolbar {
|
|||
}
|
||||
|
||||
updateLoadingIndicatorState(loading = false) {
|
||||
const pageNumberInput = this.items.pageNumber;
|
||||
const { pageNumber } = this.items;
|
||||
|
||||
pageNumberInput.classList.toggle(PAGE_NUMBER_LOADING_INDICATOR, loading);
|
||||
pageNumber.classList.toggle(PAGE_NUMBER_LOADING_INDICATOR, loading);
|
||||
}
|
||||
|
||||
updateEditorModeButtonsState(disabled = false) {
|
||||
const { editorNoneButton, editorFreeTextButton } = this.items;
|
||||
|
||||
editorNoneButton.disabled = disabled;
|
||||
editorFreeTextButton.disabled = disabled;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue