1 From 5f35008c978c291f67778bb72d39709109682d0c Mon Sep 17 00:00:00 2001
2 From: Koeun Choi <koeun.choi@samsung.com>
3 Date: Fri, 15 Jun 2012 17:11:51 +0900
4 Subject: [PATCH] JQM:nolabel n favorite class for check support
6 Signed-off-by: Koeun Choi <koeun.choi@samsung.com>
7 Signed-off-by: Youmin Ha <youmin.ha@samsung.com>
9 .../js/jquery.mobile.forms.checkboxradio.js | 12 +++++++++++-
10 1 file changed, 11 insertions(+), 1 deletion(-)
12 diff --git a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.forms.checkboxradio.js b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.forms.checkboxradio.js
13 index eb4731b..08556cf 100644
14 --- a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.forms.checkboxradio.js
15 +++ b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.forms.checkboxradio.js
16 @@ -26,7 +26,7 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
17 // NOTE: Windows Phone could not find the label through a selector
18 // filter works though.
19 parentLabel = $( input ).closest( "label" ),
20 - label = parentLabel.length ? parentLabel : $( input ).closest( "form,fieldset,:jqmData(role='page'),:jqmData(role='dialog')" ).find( "label" ).filter( "[for='" + input[0].id + "']" ),
21 + label = parentLabel.length ? parentLabel : ( input[0].id ? $( input ).closest( "form,fieldset,:jqmData(role='page'),:jqmData(role='dialog')" ).find( "label" ).filter( "[for='" + input[0].id + "']" ) : [ ] ),
22 inputtype = input[0].type,
23 mini = inheritAttr( input, "mini" ),
24 checkedState = inputtype + "-on",
25 @@ -43,6 +43,12 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
29 + // Support fake label
30 + if ( label.length == 0 ) {
31 + label = $( "<label for='" + input[ 0 ].id +
35 // Expose for other methods
38 @@ -70,6 +76,10 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
39 var wrapper = document.createElement('div');
40 wrapper.className = 'ui-' + inputtype;
42 + if ( input.hasClass( "favorite" ) ) {
43 + wrapper.className += ' favorite';
46 input.add( label ).wrapAll( wrapper );