Rough in species
This commit is contained in:
parent
dfc62cd1ac
commit
afcf24a8d8
22 changed files with 399 additions and 2 deletions
20
app/components/species/species-details.js
Normal file
20
app/components/species/species-details.js
Normal file
|
@ -0,0 +1,20 @@
|
|||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
classNames: ['grid-1'],
|
||||
isEditing: false,
|
||||
isNew: false,
|
||||
actions: {
|
||||
editSpecies: function() {
|
||||
this.get('species').get('errors').clear();
|
||||
if (this.get('isNew')) {
|
||||
this.get('species').destroyRecord().then(this.sendAction());
|
||||
}
|
||||
this.toggleProperty('isEditing');
|
||||
this.get('species').rollback();
|
||||
},
|
||||
saveSpecies: function() {
|
||||
this.get('species').save().then(this.toggleProperty('isEditing'));
|
||||
}
|
||||
}
|
||||
});
|
Reference in a new issue