Cleaning up measurement edit
This commit is contained in:
parent
40f2b789e4
commit
4b6a776b63
6 changed files with 29 additions and 42 deletions
|
@ -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();
|
||||
},
|
||||
|
||||
},
|
||||
});
|
||||
|
|
|
@ -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>
|
||||
|
|
Reference in a new issue