mirror of
https://github.com/nasa/openmct.git
synced 2025-05-10 04:22:53 +00:00
Handle the case where the pasted data is not an image (#7628)
* Handle the case where the pasted data is not an image or it is image AND text * Change method name for paste handling --------- Co-authored-by: Andrew Henry <akhenry@gmail.com>
This commit is contained in:
parent
e3adeb6a75
commit
d33da65dae
@ -31,7 +31,7 @@
|
|||||||
@drop.capture="cancelEditMode"
|
@drop.capture="cancelEditMode"
|
||||||
@drop.prevent="dropOnEntry"
|
@drop.prevent="dropOnEntry"
|
||||||
@click="selectAndEmitEntry($event, entry)"
|
@click="selectAndEmitEntry($event, entry)"
|
||||||
@paste="addImageFromPaste"
|
@paste="addImageOrTextFromPaste"
|
||||||
>
|
>
|
||||||
<div class="c-ne__time-and-content">
|
<div class="c-ne__time-and-content">
|
||||||
<div class="c-ne__time-and-creator-and-delete">
|
<div class="c-ne__time-and-creator-and-delete">
|
||||||
@ -384,7 +384,7 @@ export default {
|
|||||||
|
|
||||||
this.manageEmbedLayout();
|
this.manageEmbedLayout();
|
||||||
},
|
},
|
||||||
async addImageFromPaste(event) {
|
async addImageOrTextFromPaste(event) {
|
||||||
const clipboardItems = Array.from(
|
const clipboardItems = Array.from(
|
||||||
(event.clipboardData || event.originalEvent.clipboardData).items
|
(event.clipboardData || event.originalEvent.clipboardData).items
|
||||||
);
|
);
|
||||||
@ -409,7 +409,9 @@ export default {
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
this.manageEmbedLayout();
|
this.manageEmbedLayout();
|
||||||
this.timestampAndUpdate();
|
// the pasted clipboard data also include text (or text only and no images).
|
||||||
|
// So we will also update the text here
|
||||||
|
this.updateEntryValue(event);
|
||||||
},
|
},
|
||||||
convertMarkDownToHtml(text = '') {
|
convertMarkDownToHtml(text = '') {
|
||||||
let markDownHtml = this.marked.parse(text, {
|
let markDownHtml = this.marked.parse(text, {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user