Cleaning up measurement edit

This commit is contained in:
Matthew Dillon 2015-09-16 12:45:06 -07:00
parent 40f2b789e4
commit 4b6a776b63
6 changed files with 29 additions and 42 deletions

View file

@ -6,12 +6,15 @@ export default Ember.Component.extend({
actions: {
edit: function() {
// The parent table fetches all of the characteristics ahead of time
this.set('characteristics', this.store.peekAll('characteristic'));
this.toggleProperty('isEditing');
},
save: function() {
this.toggleProperty('isEditing');
console.log('saved');
}
this.get('row').save();
},
},
});

View file

@ -1,16 +1,22 @@
{{#if isEditing}}
<td>
{{input value='Foo'}}
{{
select-2
multiple=false
content=characteristics
value=row.characteristic
optionLabelPath="characteristicName"
}}
</td>
<td>
{{input value='Bar'}}
{{input value=row.value}}
</td>
<td>
{{input value='Baz'}}
{{input value=row.notes}}
</td>
{{#if canEdit}}
<td>
<button class="button-gray smaller" {{action 'save'}}>
<button class="button-red smaller" {{action 'save'}}>
Save
</button>
</td>
@ -22,10 +28,10 @@
{{/link-to}}
</td>
<td>
{{row.measurement.value}}
{{row.value}}
</td>
<td>
{{row.measurement.notes}}
{{row.notes}}
</td>
{{#if canEdit}}
<td>