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