Popup: Apply tizen style popup and attribute support
[platform/framework/web/web-ui-fw.git] / libs / patch / jqm-1.1.0 / 0007-JQM-remove-search-from-forms.textinput.patch
1 From c70b1f818389c9703af17bb59e1f78f4eefa7c65 Mon Sep 17 00:00:00 2001
2 From: wongi11.lee <wongi11.lee@samsung.com>
3 Date: Fri, 29 Jun 2012 13:24:49 +0900
4 Subject: [PATCH] JQM remove 'search' from forms.textinput.
5
6 Change-Id: I3de28a38dad8cfcc40a6e98273107e5beabb836e
7 Signed-off-by: wongi11.lee <wongi11.lee@samsung.com>
8 ---
9  .../js/jquery.mobile.forms.textinput.js            |   49 +++----------------
10  1 files changed, 8 insertions(+), 41 deletions(-)
11
12 diff --git a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.forms.textinput.js b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.forms.textinput.js
13 index f444522..a06d54d 100644
14 --- a/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.forms.textinput.js
15 +++ b/libs/js/jquery-mobile-1.1.0/js/jquery.mobile.forms.textinput.js
16 @@ -13,8 +13,7 @@ $.widget( "mobile.textinput", $.mobile.widget, {
17                 theme: null,
18                 // This option defaults to true on iOS devices.
19                 preventFocusZoom: /iPhone|iPad|iPod/.test( navigator.platform ) && navigator.userAgent.indexOf( "AppleWebKit" ) > -1,
20 -               initSelector: "input[type='text'], input[type='search'], :jqmData(type='search'), input[type='number'], :jqmData(type='number'), input[type='password'], input[type='email'], input[type='url'], input[type='tel'], textarea, input[type='time'], input[type='date'], input[type='month'], input[type='week'], input[type='datetime'], input[type='datetime-local'], input[type='color'], input:not([type])",
21 -               clearSearchButtonText: "clear text"
22 +               initSelector: "input[type='text'], input[type='number'], :jqmData(type='number'), input[type='password'], input[type='email'], input[type='url'], input[type='tel'], textarea, input[type='time'], input[type='date'], input[type='month'], input[type='week'], input[type='datetime'], input[type='datetime-local'], input[type='color'], input:not([type])"
23         },
24  
25         _create: function() {
26 @@ -46,41 +45,7 @@ $.widget( "mobile.textinput", $.mobile.widget, {
27                 }
28  
29  
30 -               //"search" input widget
31 -               if ( input.is( "[type='search'],:jqmData(type='search')" ) ) {
32 -
33 -                       focusedEl = input.wrap( "<div class='ui-input-search ui-shadow-inset ui-btn-corner-all ui-btn-shadow ui-icon-searchfield" + themeclass + miniclass + "'></div>" ).parent();
34 -                       clearbtn = $( "<a href='#' class='ui-input-clear' title='" + o.clearSearchButtonText + "'>" + o.clearSearchButtonText + "</a>" )
35 -                               .bind('click', function( event ) {
36 -                                       input
37 -                                               .val( "" )
38 -                                               .focus()
39 -                                               .trigger( "change" );
40 -                                       clearbtn.addClass( "ui-input-clear-hidden" );
41 -                                       event.preventDefault();
42 -                               })
43 -                               .appendTo( focusedEl )
44 -                               .buttonMarkup({
45 -                                       icon: "delete",
46 -                                       iconpos: "notext",
47 -                                       corners: true,
48 -                                       shadow: true,
49 -                                       mini: mini
50 -                               });
51 -
52 -                       function toggleClear() {
53 -                               setTimeout(function() {
54 -                                       clearbtn.toggleClass( "ui-input-clear-hidden", !input.val() );
55 -                               }, 0);
56 -                       }
57 -
58 -                       toggleClear();
59 -
60 -                       input.bind('paste cut keyup focus change blur', toggleClear);
61 -
62 -               } else {
63 -                       input.addClass( "ui-corner-all ui-shadow-inset" + themeclass + miniclass );
64 -               }
65 +               input.addClass( "ui-corner-all ui-shadow-inset" + themeclass + miniclass );
66  
67                 input.focus(function() {
68                                 focusedEl.addClass( $.mobile.focusClass );
69 @@ -133,13 +98,15 @@ $.widget( "mobile.textinput", $.mobile.widget, {
70         },
71  
72         disable: function(){
73 -               ( this.element.attr( "disabled", true ).is( "[type='search'],:jqmData(type='search')" ) ?
74 -                       this.element.parent() : this.element ).addClass( "ui-disabled" );
75 +               if ( this.element.attr( "disabled", true ) ) {
76 +                       this.element.addClass( "ui-disabled" );
77 +               }
78         },
79  
80         enable: function(){
81 -               ( this.element.attr( "disabled", false).is( "[type='search'],:jqmData(type='search')" ) ?
82 -                       this.element.parent() : this.element ).removeClass( "ui-disabled" );
83 +               if ( this.element.attr( "disabled", false) ) {
84 +                       this.element.removeClass( "ui-disabled" );
85 +               }
86         }
87  });
88  
89 -- 
90 1.7.0.4
91