Skip to content
This repository was archived by the owner on Jun 25, 2022. It is now read-only.

Commit a971cd7

Browse files
committed
Fix error with empty knobLabel (Summarize)
1 parent 762d0b8 commit a971cd7

File tree

5 files changed

+6
-4
lines changed

5 files changed

+6
-4
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "SCILLE_toogle_switch",
3-
"version": "1.0.8",
3+
"version": "1.0.9",
44
"description": "Create toggle switches.",
55
"authors": [
66
"Romain Dubois <dubois.rom@gmail.com>",

demo/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ <h2>Summarize</h2>
7979
<button ng-click="summarize = !summarize">Click me</button>
8080
<p>Summarize toggle-switch: {{summarize}}</p>
8181
<div sc-toggle-switch-directive is-summarised="summarize" ng-model="switchModel" knob-label="TV"></div>
82+
<br /><label>TV</label><div sc-toggle-switch-directive is-summarised="summarize" ng-model="switchModel"></div>
8283
</div>
8384

8485
<h2>Value labels</h2>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "SCILLE_toogle_switch",
3-
"version": "1.0.5",
3+
"version": "1.0.9",
44
"description": "Create toggle switches.",
55
"author": "DUBOIS Romain",
66
"contributors": [

release/sc-toggle-switch.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/script/toggle_switch_template.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
</span>
1010
<span ng-show="isSummarised">
1111
<div class="sc-toggle-switch-summarize" ng-class="switchSize">
12+
<span ng-show="knobLabel != '\u00a0'" class="switch-knob" ng-style="{ 'background-color': knobLabelColor }">{{knobLabel}}</span>
13+
<span ng-show="localModel == undefined" class="switch-knob" ng-style="{ 'background-color': knobLabelColor }">null</span>
1214
<span ng-show="localModel != undefined && localModel" ng-style="{ 'background-color': leftLabelColor }" class="switch-left">{{leftLabel}}</span>
13-
<span ng-show="knobLabel.length > 0" class="switch-knob" ng-style="{ 'background-color': knobLabelColor }">{{knobLabel}}</span>
1415
<span ng-show="localModel != undefined && !localModel" ng-style="{ 'background-color': rightLabelColor }" class="switch-right">{{rightLabel}}</span>
1516
</div>
1617
</span>

0 commit comments

Comments
 (0)