2014-03-31 08:07:05 +04:00
|
|
|
|
|
|
|
var UploadController = Ember.Controller.extend({
|
2014-06-06 18:44:09 +04:00
|
|
|
acceptEncoding: 'image/*',
|
2014-06-04 01:10:54 +04:00
|
|
|
actions: {
|
2014-06-20 06:29:49 +04:00
|
|
|
confirmAccept: function () {
|
|
|
|
var self = this;
|
2014-06-04 01:10:54 +04:00
|
|
|
|
2014-06-20 06:29:49 +04:00
|
|
|
this.get('model').save().then(function (model) {
|
|
|
|
self.notifications.showSuccess('Saved');
|
|
|
|
return model;
|
2014-07-22 09:27:50 +04:00
|
|
|
}).catch(function (err) {
|
|
|
|
self.notifications.showErrors(err);
|
|
|
|
});
|
2014-06-20 06:29:49 +04:00
|
|
|
},
|
|
|
|
|
|
|
|
confirmReject: function () {
|
|
|
|
return false;
|
2014-03-31 08:07:05 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2014-06-04 01:10:54 +04:00
|
|
|
export default UploadController;
|