mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
[Editor] Add the possibility to create an highlight from the context menu when some text is selected (bug 1867739)
This commit is contained in:
parent
72b8b29147
commit
e1f6f5179f
7 changed files with 266 additions and 72 deletions
|
@ -188,7 +188,7 @@ class PDFPresentationMode {
|
|||
// Text selection is disabled in Presentation Mode, thus it's not possible
|
||||
// for the user to deselect text that is selected (e.g. with "Select all")
|
||||
// when entering Presentation Mode, hence we remove any active selection.
|
||||
window.getSelection().removeAllRanges();
|
||||
document.getSelection().empty();
|
||||
}
|
||||
|
||||
#exit() {
|
||||
|
|
|
@ -126,6 +126,14 @@ class Toolbar {
|
|||
);
|
||||
}
|
||||
|
||||
eventBus._on("showannotationeditorui", ({ mode }) => {
|
||||
switch (mode) {
|
||||
case AnnotationEditorType.HIGHLIGHT:
|
||||
options.editorHighlightButton.click();
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
this.reset();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue