textarea-markdown
Advanced tools
Comparing version 1.2.11 to 1.3.0
@@ -29,2 +29,3 @@ 'use strict'; | ||
this.options = Object.assign({ | ||
useUploader: true, | ||
endPoint: '/api/image.json', | ||
@@ -47,5 +48,7 @@ paramName: 'file', | ||
this.applyPreview(); | ||
textarea.addEventListener("drop", function (e) { | ||
return _this.drop(e); | ||
}); | ||
if (this.options.useUploader) { | ||
textarea.addEventListener("drop", function (e) { | ||
return _this.drop(e); | ||
}); | ||
} | ||
textarea.addEventListener("paste", function (e) { | ||
@@ -52,0 +55,0 @@ return _this.paste(e); |
{ | ||
"name": "textarea-markdown", | ||
"version": "1.2.11", | ||
"version": "1.3.0", | ||
"description": "Make textarea a markdown editor.", | ||
@@ -5,0 +5,0 @@ "main": "lib/textarea-markdown.js", |
@@ -51,1 +51,9 @@ # textarea-markdown | ||
``` | ||
### Options | ||
#### useUploader | ||
- type: Boolean | ||
- default: true | ||
Enable uploading files on drop when the value is set to true |
@@ -8,2 +8,3 @@ import 'whatwg-fetch' | ||
this.options = Object.assign({ | ||
useUploader: true, | ||
endPoint: '/api/image.json', | ||
@@ -26,3 +27,5 @@ paramName: 'file', | ||
this.applyPreview(); | ||
textarea.addEventListener("drop", e => this.drop(e)); | ||
if(this.options.useUploader) { | ||
textarea.addEventListener("drop", e => this.drop(e)); | ||
} | ||
textarea.addEventListener("paste", e => this.paste(e)); | ||
@@ -29,0 +32,0 @@ textarea.addEventListener("keyup", e => this.keyup(e)); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19229
373
59