Pulling stuff back out of strain component
This commit is contained in:
parent
7260b95937
commit
033ff530d2
9 changed files with 67 additions and 24 deletions
|
@ -3,18 +3,12 @@ import Ember from 'ember';
|
|||
export default Ember.Component.extend({
|
||||
classNames: ['grid-1'],
|
||||
isEditing: false,
|
||||
isNew: false,
|
||||
actions: {
|
||||
editStrain: function() {
|
||||
this.get('strain').get('errors').clear();
|
||||
if (this.get('isNew')) {
|
||||
this.get('strain').destroyRecord().then(this.sendAction());
|
||||
}
|
||||
this.toggleProperty('isEditing');
|
||||
this.get('strain').rollback();
|
||||
save: function() {
|
||||
this.sendAction('save');
|
||||
},
|
||||
cancel: function() {
|
||||
this.sendAction('cancel');
|
||||
},
|
||||
saveStrain: function() {
|
||||
this.get('strain').save().then(this.toggleProperty('isEditing'));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Reference in a new issue