-
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING CHANGE: Removed label values and made the action simple, passing only a single boolean value. Fixes the value change bug. More changes to come.
- Loading branch information
Ilya Radchenko
committed
Apr 6, 2017
1 parent
dbe139d
commit ae1a0b6
Showing
3 changed files
with
70 additions
and
171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,31 @@ | ||
{{#if showLabels}} | ||
<label id='off-label-{{elementId}}' for={{forId}} class="toggle-text toggle-prefix off-label" onclick={{action 'setToValue' false}}> | ||
{{_offLabel}} | ||
<label id='off-label-{{elementId}}' for={{forId}} class="toggle-text toggle-prefix off-label" | ||
onclick={{action 'setToValue' false}}> | ||
{{offLabel}} | ||
</label> | ||
{{/if}} | ||
|
||
<span | ||
class="x-toggle-container {{size}}{{if toggled ' x-toggle-container-checked'}}{{if disabled ' x-toggle-container-disabled'}}" | ||
> | ||
<input | ||
id="input-{{elementId}}" | ||
<span class="x-toggle-container {{size}}{{if value ' x-toggle-container-checked'}}{{if disabled ' x-toggle-container-disabled'}}"> | ||
<input id="input-{{elementId}}" | ||
name={{name}} | ||
type='checkbox' | ||
checked={{toggled}} | ||
changed={{action 'setToValue' value='target.checked'}} | ||
class='x-toggle' | ||
disabled={{disabled}} | ||
> | ||
disabled={{disabled}}> | ||
|
||
<div | ||
id="visual-{{elementId}}" | ||
class="x-toggle-btn {{themeClass}} {{size}}{{if disabled ' x-toggle-disabled'}}{{invalidState}}" | ||
data-tg-off={{_offLabel}} | ||
data-tg-on={{_onLabel}} | ||
<div id="visual-{{elementId}}" | ||
class="x-toggle-btn {{themeClass}} {{size}}{{if disabled ' x-toggle-disabled'}}" | ||
onclick={{action 'onClick'}} | ||
for="input-{{elementId}}" | ||
aria-role="checkbox" | ||
aria-owns="input-{{elementId}}" | ||
> | ||
aria-owns="input-{{elementId}}"> | ||
</div> | ||
</span> | ||
|
||
{{#if showLabels}} | ||
<label id='on-label-{{elementId}}' for="input-{{elementId}}" class="toggle-text toggle-postfix {{size}} on-label" onclick={{action 'setToValue' true}}> | ||
{{_onLabel}} | ||
<label id='on-label-{{elementId}}' for="input-{{elementId}}" class="toggle-text toggle-postfix {{size}} on-label" | ||
onclick={{action 'setToValue' true}}> | ||
{{onLabel}} | ||
</label> | ||
{{/if}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters