Don't filter env vars in controller
Depending on isNew can result in rerendering templates in some cases, which will also create a new object controller, which in turn will reset isEditing value.
This commit is contained in:
parent
ab33383d15
commit
95619b42fb
|
@ -1,6 +1,6 @@
|
|||
`import Ember from 'ember'`
|
||||
|
||||
Controller = Ember.ArrayController.extend
|
||||
vars: Ember.computed.filterBy('model', 'isNew', false)
|
||||
vars: Ember.computed.alias('model')
|
||||
|
||||
`export default Controller`
|
||||
|
|
|
@ -2,17 +2,19 @@
|
|||
|
||||
<ul class="env-vars">
|
||||
{{#each vars itemController="envVar"}}
|
||||
<li class="env-var">
|
||||
{{#if isEditing}}
|
||||
{{partial 'env_vars/form'}}
|
||||
{{else}}
|
||||
<a href="#" class="edit-var" {{action "edit"}}>Edit</a>
|
||||
<a href="#" {{action "delete"}} {{bind-attr class=":delete-var isDeleting:deleting"}}>
|
||||
Delete
|
||||
</a>
|
||||
<span class="name">{{name}}</span>
|
||||
<span {{bind-attr class=":value :value-display public::secure"}}>{{value}}</span>
|
||||
{{/if}}
|
||||
</li>
|
||||
{{#unless isNew}}
|
||||
<li class="env-var">
|
||||
{{#if isEditing}}
|
||||
{{partial 'env_vars/form'}}
|
||||
{{else}}
|
||||
<a href="#" class="edit-var" {{action "edit"}}>Edit</a>
|
||||
<a href="#" {{action "delete"}} {{bind-attr class=":delete-var isDeleting:deleting"}}>
|
||||
Delete
|
||||
</a>
|
||||
<span class="name">{{name}}</span>
|
||||
<span {{bind-attr class=":value :value-display public::secure"}}>{{value}}</span>
|
||||
{{/if}}
|
||||
</li>
|
||||
{{/unless}}
|
||||
{{/each}}
|
||||
</ul>
|
||||
|
|
Loading…
Reference in New Issue
Block a user