From ffdab6ff32bd82ebfb7be7c6c736fcf8becb4563 Mon Sep 17 00:00:00 2001 From: Ghislain Seguin Date: Thu, 23 Jun 2011 17:03:22 -0700 Subject: [PATCH] Fixed a glitch in the icon class name generation. It was adding ui-icon-ui-icon-checkbox-off to the checkbox icon element (2x ui-icon) and similar to radio icon element --- js/jquery.mobile.forms.checkboxradio.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/js/jquery.mobile.forms.checkboxradio.js b/js/jquery.mobile.forms.checkboxradio.js index 70edbb16..9590fa31 100644 --- a/js/jquery.mobile.forms.checkboxradio.js +++ b/js/jquery.mobile.forms.checkboxradio.js @@ -16,10 +16,12 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, { //filter works though. label = input.closest("form,fieldset,:jqmData(role='page')").find("label").filter('[for="' + input[0].id + '"]'), inputtype = input.attr( "type" ), - checkedClass = "ui-"+ inputtype + "-on", - uncheckedClass = "ui-"+ inputtype + "-off", - checkedicon = "ui-icon-" + inputtype + "-on", - uncheckedicon = "ui-icon-" + inputtype + "-off"; + checkedState = inputtype + "-on", + uncheckedState = inputtype + "-off", + checkedClass = "ui-"+ checkedState, + uncheckedClass = "ui-"+ uncheckedState, + checkedicon = "ui-icon-" + checkedState, + uncheckedicon = "ui-icon-" + uncheckedState; if ( inputtype != "checkbox" && inputtype != "radio" ) { return; } @@ -41,7 +43,7 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, { label .buttonMarkup({ theme: this.options.theme, - icon: this.element.parents( ":jqmData(type='horizontal')" ).length ? undefined : uncheckedicon, + icon: this.element.parents( ":jqmData(type='horizontal')" ).length ? undefined : uncheckedState, shadow: false });