Skip to content

Commit

Permalink
Ensure checkbox is checked when clicked
Browse files Browse the repository at this point in the history
Using a single checked attribute for this didn't work because clicking
on it changed the state.  Instead we have to create a new box for each
case so it stays checked when clicked.
  • Loading branch information
jrjohnson committed Aug 12, 2016
1 parent d7067e8 commit 8a62381
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions app/templates/components/objective-manage-competency.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
{{#if (contains domain.id (map-by 'id' (await domainsWithNoChildren)))}}
<li {{action (if (eq domain.id objective.competency.id) 'removeCurrentCompetency' 'changeCompetency') domain}} class="competency-title clickable {{if (eq domain.id objective.competency.id) 'selected'}}">
<h5>
{{input type='checkbox' checked=(eq domain.id objective.competency.id)}}
{{#if (eq domain.id objective.competency.id)}}
<input type='checkbox' checked />
{{else}}
<input type='checkbox' />
{{/if}}
{{domain.title}}
</h5>
</li>
Expand All @@ -19,7 +23,11 @@
{{#each (sort-by 'title' (await domain.children)) as |competency|}}
{{#if (contains competency.id (map-by 'id' (await competencies)))}}
<li {{action (if (eq competency.id objective.competency.id) 'removeCurrentCompetency' 'changeCompetency') competency}} class="competency-title clickable {{if (eq competency.id objective.competency.id) 'selected'}}">
{{input type='checkbox' checked=(eq competency.id objective.competency.id)}}
{{#if (eq competency.id objective.competency.id)}}
<input type='checkbox' checked />
{{else}}
<input type='checkbox' />
{{/if}}
{{competency.title}}
</li>
{{/if}}
Expand Down

0 comments on commit 8a62381

Please sign in to comment.