Skip to content

Commit 989e075

Browse files
authored
Adds new options params and possibility to not subtract from max files count when using manuallyAddFile for backward compatibility
1 parent cacd770 commit 989e075

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/index.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,15 @@
118118
}
119119
},
120120
methods: {
121-
manuallyAddFile: function (file, fileUrl, callback, crossOrigin) {
121+
manuallyAddFile: function (file, fileUrl, callback, crossOrigin, options) {
122122
this.dropzone.emit("addedfile", file);
123123
this.dropzone.emit("thumbnail", file, fileUrl);
124124
this.dropzone.createThumbnailFromUrl(file, fileUrl, callback, crossOrigin);
125125
this.dropzone.emit("complete", file);
126126
this.$emit('vdropzone-file-added-manually', file);
127-
this.dropzone.options['maxFiles'] = this.dropzone.options['maxFiles'] - 1;
127+
if ((typeof options.dontSubstractMaxFiles == 'undefined') || !options.dontSubstractMaxFiles) {
128+
this.dropzone.options['maxFiles'] = this.dropzone.options['maxFiles'] - 1;
129+
}
128130
},
129131
setOption: function (option, value) {
130132
this.dropzone.options[option] = value
@@ -407,4 +409,4 @@
407409
}
408410
}
409411
}
410-
</style>
412+
</style>

0 commit comments

Comments
 (0)