Artur Paikin преди 6 години
родител
ревизия
da35ab4820
променени са 2 файла, в които са добавени 15 реда и са изтрити 9 реда
  1. 12 6
      website/src/examples/markdown-snippets/app.css
  2. 3 3
      website/src/examples/markdown-snippets/app.es6

+ 12 - 6
website/src/examples/markdown-snippets/app.css

@@ -26,6 +26,7 @@
   padding: 6px;
   padding: 6px;
   border-radius: 5px;
   border-radius: 5px;
   border: 1px solid #b7b7b4;
   border: 1px solid #b7b7b4;
+  border-bottom: 1px dashed #b7b7b4;
   min-height: 160px;
   min-height: 160px;
   width: 100%;
   width: 100%;
   resize: vertical;
   resize: vertical;
@@ -35,12 +36,17 @@
   border-bottom-right-radius: 0;
   border-bottom-right-radius: 0;
 }
 }
 
 
-.form-textarea:focus,
-.form-snippetTitle-input:focus {
-  border-color: #7db9e5;
-  outline: none;
-  box-shadow: 0 0 1px 1px #7db9e5;
-}
+  .form-textarea:focus,
+  .form-snippetTitle-input:focus {
+    border-color: #7db9e5;
+    outline: none;
+    box-shadow: 0 0 1px 1px #7db9e5;
+  }
+
+  .form-textarea.drag {
+    background-color: #dee1e3;
+    border: 3px dashed #7f8a93;
+  }
 
 
 .form-createSnippet {
 .form-createSnippet {
   -webkit-appearance: none;
   -webkit-appearance: none;

+ 3 - 3
website/src/examples/markdown-snippets/app.es6

@@ -26,7 +26,7 @@ class MarkdownTextarea {
     this.uploadLine.classList.add('form-upload')
     this.uploadLine.classList.add('form-upload')
 
 
     this.uploadLine.appendChild(
     this.uploadLine.appendChild(
-      document.createTextNode('Tap to upload an attachment'))
+      document.createTextNode('Tap here or drop files to upload an attachment'))
   }
   }
 
 
   install () {
   install () {
@@ -39,6 +39,7 @@ class MarkdownTextarea {
     wrapper.appendChild(this.uploadLine)
     wrapper.appendChild(this.uploadLine)
 
 
     this.setupUploadLine()
     this.setupUploadLine()
+    this.setupTextareaDrop()
   }
   }
 
 
   setupTextareaDrop () {
   setupTextareaDrop () {
@@ -48,7 +49,6 @@ class MarkdownTextarea {
   }
   }
 
 
   setupUploadLine () {
   setupUploadLine () {
-    console.log(this.uploadLine)
     this.uploadLine.addEventListener('click', () => {
     this.uploadLine.addEventListener('click', () => {
       this.pickFiles()
       this.pickFiles()
     })
     })
@@ -103,7 +103,7 @@ class MarkdownTextarea {
   }
   }
 
 
   uploadFiles (files) {
   uploadFiles (files) {
-    robodog.upload({
+    robodog.upload(files, {
       waitForEncoding: true,
       waitForEncoding: true,
       params: {
       params: {
         auth: { key: TRANSLOADIT_EXAMPLE_KEY },
         auth: { key: TRANSLOADIT_EXAMPLE_KEY },