Skip to content

Commit 9f07a1c

Browse files
author
scottjehl
committed
ensure that the active button state is still applied to check and radio sets that don't have icons
1 parent ffdab6f commit 9f07a1c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

js/jquery.mobile.forms.checkboxradio.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
1818
inputtype = input.attr( "type" ),
1919
checkedState = inputtype + "-on",
2020
uncheckedState = inputtype + "-off",
21-
checkedClass = "ui-"+ checkedState,
21+
icon = input.parents( ":jqmData(type='horizontal')" ).length ? undefined : uncheckedState,
22+
activeBtn = icon ? "" : " " + $.mobile.activeBtnClass,
23+
checkedClass = "ui-"+ checkedState + activeBtn,
2224
uncheckedClass = "ui-"+ uncheckedState,
2325
checkedicon = "ui-icon-" + checkedState,
2426
uncheckedicon = "ui-icon-" + uncheckedState;
@@ -43,7 +45,7 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
4345
label
4446
.buttonMarkup({
4547
theme: this.options.theme,
46-
icon: this.element.parents( ":jqmData(type='horizontal')" ).length ? undefined : uncheckedState,
48+
icon: icon,
4749
shadow: false
4850
});
4951

0 commit comments

Comments
 (0)