Skip to content

Commit

Permalink
=
Browse files Browse the repository at this point in the history
  • Loading branch information
arikaim-repository committed Mar 17, 2020
1 parent 3d446ec commit 1752984
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions upload/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

function FileUpload(formId, options) {
var defaultIdleLabel = "Drag & Drop file or <span class='filepond--label-action'> Browse </span>";
var filepondId;

this.registerPlugin = function(plugIn) {
if (isEmpty(plugIn) == false && isObject(FilePond) == true) {
Expand All @@ -17,15 +18,23 @@ function FileUpload(formId, options) {
return false;
};

this.reset = function() {
var files = $(filepondId).filepond('getFiles');

files.forEach(function(file) {
$(filepondId).filepond('removeFile',file.id);
});
};

this.init = function(formId, options) {
var maxFiles = getValue('maxFiles',options,1);
var idleLabel = getValue('idleLabel',options,defaultIdleLabel);
var acceptedFileTypes = getValue('acceptedFileTypes',options,["*"]);
var instantUpload = getValue('instantUpload',options,false);
var url = getValue('url',options,'/api/storage/admin/upload');
var formFields = getValue('formFields',options,{});
var filepondId = getValue('filepondId',options,'#file');
var formFields = getValue('formFields',options,{});
var allowMultiple = getValue('allowMultiple',options,false);
filepondId = getValue('filepondId',options,'#file');

//File type validatin plugin
this.registerPlugin(FilePondPluginFileValidateType);
Expand Down

0 comments on commit 1752984

Please sign in to comment.