vendor/assets/javascripts/base/_filepicker.js in active_frontend-14.0.77 vs vendor/assets/javascripts/base/_filepicker.js in active_frontend-14.0.78

- old
+ new

@@ -34,10 +34,12 @@ buttonText: 'Browse', disabled: false, iconClass: 'icon-folder-open', inputClass: 'form-input', inputPlaceholder: 'Select a file...', + onFilesDeselectedCallback: function () {}, + onFilesSelectedCallback: function (count) {}, showBadge: true, showIcon: true, showInput: true }; @@ -62,9 +64,15 @@ if (this.options.disabled) this.$element.attr('disabled', 'true'); this.$element.change(function () { var files = _self.pushNameFiles(); + + if (files.length === 0) { + _self.options.onFilesDeselectedCallback(); + } else { + _self.options.onFilesSelectedCallback(files.length); + } if (_self.options.showInput === false && _self.options.showBadge) { if (_self.$elementFilepicker.find('.badge').length === 0) { _self.badgeAppend(files); } else if (files.length === 0) {