mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-20 22:03:03 +08:00
Merge pull request #6535 from aignatov-bio/ai-sci-9588-add-paste-image
Fix web insert image [SCI-9127]
This commit is contained in:
commit
0696af987c
1 changed files with 7 additions and 2 deletions
|
@ -19,8 +19,13 @@ export default {
|
|||
},
|
||||
getImagesFromClipboard(e) {
|
||||
let image = null;
|
||||
if (e.clipboardData && e.clipboardData.items) image = e.clipboardData.items[0];
|
||||
if (image && image.type.indexOf('image') === -1) image = null
|
||||
if (e.clipboardData) {
|
||||
for (let i = 0; i < e.clipboardData.items.length; i++) {
|
||||
if (e.clipboardData.items[i].type.indexOf('image') !== -1) {
|
||||
image = e.clipboardData.items[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
return image;
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue