ensure that the active button state is still applied to check and radio sets that don't have icons

This commit is contained in:
scottjehl 2011-06-24 11:00:51 -04:00
parent ffdab6ff32
commit 9f07a1cfb2

View file

@ -18,7 +18,9 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
inputtype = input.attr( "type" ),
checkedState = inputtype + "-on",
uncheckedState = inputtype + "-off",
checkedClass = "ui-"+ checkedState,
icon = input.parents( ":jqmData(type='horizontal')" ).length ? undefined : uncheckedState,
activeBtn = icon ? "" : " " + $.mobile.activeBtnClass,
checkedClass = "ui-"+ checkedState + activeBtn,
uncheckedClass = "ui-"+ uncheckedState,
checkedicon = "ui-icon-" + checkedState,
uncheckedicon = "ui-icon-" + uncheckedState;
@ -43,7 +45,7 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
label
.buttonMarkup({
theme: this.options.theme,
icon: this.element.parents( ":jqmData(type='horizontal')" ).length ? undefined : uncheckedState,
icon: icon,
shadow: false
});