mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 01:10:08 +02:00
[Editor] Add the possibility to create a new editor in using the keyboard (bug 1853424)
When an editing button is disabled, focused and the user press Enter (or space), an editor is automatically added at the center of the current page. Next creations can be done in using the same keys within the focused page.
This commit is contained in:
parent
a60f90ae94
commit
ea5eafa265
5 changed files with 218 additions and 9 deletions
|
@ -2208,7 +2208,7 @@ class PDFViewer {
|
|||
/**
|
||||
* @param {number} mode - AnnotationEditor mode (None, FreeText, Ink, ...)
|
||||
*/
|
||||
set annotationEditorMode({ mode, editId = null }) {
|
||||
set annotationEditorMode({ mode, editId = null, isFromKeyboard = false }) {
|
||||
if (!this.#annotationEditorUIManager) {
|
||||
throw new Error(`The AnnotationEditor is not enabled.`);
|
||||
}
|
||||
|
@ -2227,7 +2227,7 @@ class PDFViewer {
|
|||
mode,
|
||||
});
|
||||
|
||||
this.#annotationEditorUIManager.updateMode(mode, editId);
|
||||
this.#annotationEditorUIManager.updateMode(mode, editId, isFromKeyboard);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line accessor-pairs
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue