Ghost/core/client/components/file-upload.js
Peter Szel 716a09a452 Ported logic to settings: Debug Tab closes #2424
- Added file upload component
- Added import client logic
- Added e-mail sending client logic
- Added settings model
2014-05-07 20:48:29 +01:00

24 lines
652 B
JavaScript

var FileUpload = Ember.Component.extend({
_file: null,
uploadButtonText: 'Text',
uploadButtonDisabled: true,
change: function (event) {
this.set('uploadButtonDisabled', false);
this.sendAction('onAdd');
this._file = event.target.files[0];
},
actions: {
upload: function () {
var self = this;
if (!this.uploadButtonDisabled && self._file) {
self.sendAction('onUpload', self._file);
}
// Prevent double post by disabling the button.
this.set('uploadButtonDisabled', true);
}
}
});
export default FileUpload;