diff --git a/app/components/file-field.js b/app/components/file-field.js index 784c77d..d553a2d 100644 --- a/app/components/file-field.js +++ b/app/components/file-field.js @@ -4,26 +4,25 @@ export default Ember.TextField.extend({ type: 'file', classNames: ['invisible'], - click: function (event) { + click(event) { event.stopPropagation(); }, - change: function (event) { - var input = event.target, - files = input.files, - file = files[0]; + change(event) { + const input = event.target; + const files = input.files; + const file = files[0]; this.sendAction('action', { file: file }); + this.reset() }, // Hackish way to reset file input when sender cancels file transfer, // so if sender wants later to send the same file again, // the 'change' event is triggered correctly. - fileDidChange: function () { - if (!this.get('file')) { - var field = this.$(); - field.wrap('