Browse Source

:recycle: upload

Liyuan Li 5 years ago
parent
commit
01d2356d82
2 changed files with 5 additions and 1 deletions
  1. 4 0
      src/ts/ir/index.ts
  2. 1 1
      src/ts/upload/index.ts

+ 4 - 0
src/ts/ir/index.ts

@@ -72,6 +72,10 @@ class IR {
         });
 
         // TODO
+        this.element.addEventListener("paste", (event: ClipboardEvent & { target: HTMLElement }) => {
+
+        })
+
         if (vditor.options.upload.url || vditor.options.upload.handler) {
             this.element.addEventListener("drop",
                 (event: CustomEvent & { dataTransfer?: DataTransfer, target: HTMLElement }) => {

+ 1 - 1
src/ts/upload/index.ts

@@ -135,7 +135,7 @@ const genUploadedLabel = (responseText: string, vditor: IVditor) => {
         }
     });
     setSelectionFocus(vditor.upload.range);
-    if (vditor.currentMode === "wysiwyg") {
+    if (vditor.currentMode !== "sv") {
         document.execCommand("insertHTML", false, succFileText);
     } else {
         insertText(vditor, succFileText, "", true);