4e57495d685f5b2a237c7d1743ab213e1567757c
[platform/framework/web/web-ui-fw.git] / libs / patch / jqm-1.1.0 / 0002-JQM-nolabel-n-favorite-class-for-check-support.patch
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
5
6 Signed-off-by: Koeun Choi <koeun.choi@samsung.com>
7 Signed-off-by: Youmin Ha <youmin.ha@samsung.com>
8 ---
9  .../js/jquery.mobile.forms.checkboxradio.js        |   12 +++++++++++-
10  1 file changed, 11 insertions(+), 1 deletion(-)
11
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, {
26                         return;
27                 }
28  
29 +               // Support fake label
30 +               if ( label.length == 0 ) {
31 +                       label = $( "<label for='" + input[ 0 ].id  +
32 +                               "'></label>" );
33 +               }
34 +
35                 // Expose for other methods
36                 $.extend( this, {
37                         label: label,
38 @@ -70,6 +76,10 @@ $.widget( "mobile.checkboxradio", $.mobile.widget, {
39                 var wrapper = document.createElement('div');
40                 wrapper.className = 'ui-' + inputtype;
41  
42 +               if ( input.hasClass( "favorite" ) ) {
43 +                       wrapper.className += ' favorite';
44 +               }
45 +
46                 input.add( label ).wrapAll( wrapper );
47  
48                 label.bind({
49 -- 
50 1.7.9.5
51