X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/a6633642232efd164d4708967ab59e498fbff896..refs/pull/4032/head:/resources/js/components/dropzone.js diff --git a/resources/js/components/dropzone.js b/resources/js/components/dropzone.js index e7273df62..911a033c7 100644 --- a/resources/js/components/dropzone.js +++ b/resources/js/components/dropzone.js @@ -1,16 +1,14 @@ import DropZoneLib from "dropzone"; import {fadeOut} from "../services/animations"; +import {Component} from "./component"; -/** - * Dropzone - * @extends {Component} - */ -class Dropzone { +export class Dropzone extends Component { setup() { this.container = this.$el; this.url = this.$opts.url; this.successMessage = this.$opts.successMessage; this.removeMessage = this.$opts.removeMessage; + this.uploadLimit = Number(this.$opts.uploadLimit); this.uploadLimitMessage = this.$opts.uploadLimitMessage; this.timeoutMessage = this.$opts.timeoutMessage; @@ -19,7 +17,7 @@ class Dropzone { addRemoveLinks: true, dictRemoveFile: this.removeMessage, timeout: Number(window.uploadTimeout) || 60000, - maxFilesize: Number(window.uploadLimit) || 256, + maxFilesize: this.uploadLimit, url: this.url, withCredentials: true, init() { @@ -72,6 +70,4 @@ class Dropzone { removeAll() { this.dz.removeAllFiles(true); } -} - -export default Dropzone; \ No newline at end of file +} \ No newline at end of file