From 9f07a1cfb2c3ede99157eee858e094b49752dc35 Mon Sep 17 00:00:00 2001 From: scottjehl Date: Fri, 24 Jun 2011 11:00:51 -0400 Subject: [PATCH] ensure that the active button state is still applied to check and radio sets that don't have icons --- js/jquery.mobile.forms.checkboxradio.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/js/jquery.mobile.forms.checkboxradio.js b/js/jquery.mobile.forms.checkboxradio.js index 9590fa31..1313fcc2 100644 --- a/js/jquery.mobile.forms.checkboxradio.js +++ b/js/jquery.mobile.forms.checkboxradio.js @@ -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 });