Add new strain
This commit is contained in:
parent
c5b28f7204
commit
dfc62cd1ac
6 changed files with 36 additions and 1 deletions
|
@ -3,10 +3,15 @@ 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();
|
||||
},
|
||||
saveStrain: function() {
|
||||
this.get('strain').save().then(this.toggleProperty('isEditing'));
|
||||
|
|
Reference in a new issue