vgapp 1.0.6 → 1.0.7

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.
@@ -638,6 +638,18 @@ class VGFiles extends VGFilesBase {
638
638
  const name = normalizeData(Manipulator.get(button, 'data-name'));
639
639
  const size = normalizeData(Manipulator.get(button, 'data-size'));
640
640
  const id = normalizeData(Manipulator.get(button, 'data-id'));
641
+ const emitRemove = () => {
642
+ const payload = {
643
+ button: button,
644
+ name: name,
645
+ size: size,
646
+ id: id,
647
+ remaining: this._files.length
648
+ };
649
+
650
+ this._triggerCallback('onRemoveFile', payload);
651
+ this._triggerEvent('remove', payload);
652
+ };
641
653
 
642
654
  const fileToRemove = this._files.find(f => f.name === name && f.size === size);
643
655
  if (fileToRemove) {
@@ -689,6 +701,8 @@ class VGFiles extends VGFilesBase {
689
701
  if (this._params.removes.single.toast) {
690
702
  VGToast.run(data?.response?.message);
691
703
  }
704
+
705
+ emitRemove();
692
706
  };
693
707
 
694
708
  if (this._params.removes.single.alert) {
@@ -720,20 +734,10 @@ class VGFiles extends VGFilesBase {
720
734
  this._files = this._files.filter(f => !(f.name === name && f.size === size));
721
735
  this._updateStatsAfterRemove();
722
736
  this._files.length ? this.build() : this.clear(true);
737
+ emitRemove();
723
738
  }
724
739
 
725
740
  this._resetFileInput();
726
-
727
- const payload = {
728
- button: button,
729
- name: name,
730
- size: size,
731
- id: id,
732
- remaining: this._files.length
733
- };
734
-
735
- this._triggerCallback('onRemoveFile', payload);
736
- this._triggerEvent('remove', payload);
737
741
  }
738
742
 
739
743
  _updateStatsAfterRemove() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vgapp",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "",
5
5
  "author": {
6
6
  "name": "Vegas Studio",