Use inline content disposition for common images and PDFs (#6924)
* Use inline content disposition for common images and PDFs * Add double-click on widgets to download
This commit is contained in:
@@ -86,6 +86,9 @@ export default class Attachment extends Node {
|
||||
href={node.attrs.href}
|
||||
title={node.attrs.title}
|
||||
onMouseDown={this.handleSelect(props)}
|
||||
onDoubleClick={() => {
|
||||
this.editor.commands.downloadAttachment();
|
||||
}}
|
||||
onClick={(event) => {
|
||||
if (isEditable) {
|
||||
event.preventDefault();
|
||||
@@ -159,6 +162,7 @@ export default class Attachment extends Node {
|
||||
// create a temporary link node and click it
|
||||
const link = document.createElement("a");
|
||||
link.href = node.attrs.href;
|
||||
link.target = "_blank";
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user