Allow inserting images over context menu

Fixes #2759
This commit is contained in:
Martynas Bagdonas 2022-09-01 11:49:30 +03:00
parent ae5de2c2f5
commit f893206dfd
3 changed files with 5 additions and 1 deletions

View file

@ -713,6 +713,9 @@ class EditorInstance {
} }
menuitem.setAttribute('checked', item.checked); menuitem.setAttribute('checked', item.checked);
menuitem.addEventListener('command', () => { menuitem.addEventListener('command', () => {
if (item.name === 'insertImage') {
return this._iframeWindow.eval('openImageFilePicker()');
}
this._postMessage({ this._postMessage({
action: 'contextMenuAction', action: 'contextMenuAction',
ctxAction: item.name, ctxAction: item.name,

View file

@ -1342,6 +1342,7 @@ noteEditor.applyAnnotationColors = Show Annotation Colors
noteEditor.removeAnnotationColors = Hide Annotation Colors noteEditor.removeAnnotationColors = Hide Annotation Colors
noteEditor.addCitations = Show Annotation Citations noteEditor.addCitations = Show Annotation Citations
noteEditor.removeCitations = Hide Annotation Citations noteEditor.removeCitations = Hide Annotation Citations
noteEditor.image = Image
noteEditor.math = Math noteEditor.math = Math
noteEditor.table = Table noteEditor.table = Table
noteEditor.insertRowBefore = Insert Row Above noteEditor.insertRowBefore = Insert Row Above

@ -1 +1 @@
Subproject commit 29372d3801665c21ebc0a8d6661df88bebd0ea29 Subproject commit 658dd43e19e77fe89cd0e0e9342b0ab2427345a7