@osimatic/helpers-js 1.3.4 → 1.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,6 @@
1
1
  class MultiFilesInput {
2
- static init(fileInput, filesList, nbMaxFiles, maxFileSize) {
2
+ static init(fileInput, setFilesList, nbMaxFiles, maxFileSize) {
3
+ let filesList = [];
3
4
  const formGroup = fileInput.closest('.form-group');
4
5
 
5
6
  if (formGroup.find('.multi_files_input_dropzone').length === 0) {
@@ -61,6 +62,7 @@ class MultiFilesInput {
61
62
  continue;
62
63
  }
63
64
  filesList.push(f);
65
+ setFilesList(filesList);
64
66
  renderPreview(f);
65
67
  }
66
68
  }
@@ -93,6 +95,7 @@ class MultiFilesInput {
93
95
  // remove by reference: find corresponding file by name+size (best-effort)
94
96
  const name = file.name, size = file.size;
95
97
  filesList = filesList.filter(f => !(f.name === name && f.size === size));
98
+ setFilesList(filesList);
96
99
  $(this).closest('[data-file-id]').remove();
97
100
 
98
101
  if (filesList.length === 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@osimatic/helpers-js",
3
- "version": "1.3.4",
3
+ "version": "1.3.5",
4
4
  "main": "main.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"