Revert "[checkboxradio] exception handling for input"
[platform/framework/web/web-ui-fw.git] / libs / patch / 0019-JQM-remove-search-from-forms.textinput.patch
1 From 4b9929185d24ea9230e51bf1f02692e7da69a8cc Mon Sep 17 00:00:00 2001
2 From: Minkyu Kang <mk7.kang@samsung.com>
3 Date: Thu, 29 Nov 2012 10:41:59 +0900
4 Subject: [PATCH] JQM: remove search from forms.textinput.
5
6 Signed-off-by: wongi11.lee <wongi11.lee@samsung.com>
7 Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
8 ---
9  .../js/widgets/forms/textinput.js                  |   46 +++-----------------
10  1 file changed, 7 insertions(+), 39 deletions(-)
11
12 diff --git a/libs/js/jquery-mobile-1.2.0/js/widgets/forms/textinput.js b/libs/js/jquery-mobile-1.2.0/js/widgets/forms/textinput.js
13 index 08505ed..530cdb8 100644
14 --- a/libs/js/jquery-mobile-1.2.0/js/widgets/forms/textinput.js
15 +++ b/libs/js/jquery-mobile-1.2.0/js/widgets/forms/textinput.js
16 @@ -14,8 +14,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                 disabled: false
24         },
25  
26 @@ -54,37 +53,6 @@ $.widget( "mobile.textinput", $.mobile.widget, {
27                         input[0].setAttribute( "autocomplete", "off" );
28                 }
29  
30 -
31 -               //"search" input widget
32 -               if ( input.is( "[type='search'],:jqmData(type='search')" ) ) {
33 -
34 -                       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();
35 -                       clearbtn = $( "<a href='#' class='ui-input-clear' title='" + o.clearSearchButtonText + "'>" + o.clearSearchButtonText + "</a>" )
36 -                               .bind('click', function( event ) {
37 -                                       input
38 -                                               .val( "" )
39 -                                               .focus()
40 -                                               .trigger( "change" );
41 -                                       clearbtn.addClass( "ui-input-clear-hidden" );
42 -                                       event.preventDefault();
43 -                               })
44 -                               .appendTo( focusedEl )
45 -                               .buttonMarkup({
46 -                                       icon: "delete",
47 -                                       iconpos: "notext",
48 -                                       corners: true,
49 -                                       shadow: true,
50 -                                       mini: mini
51 -                               });
52 -
53 -                       toggleClear();
54 -
55 -                       input.bind( 'paste cut keyup focus change blur', toggleClear );
56 -
57 -               } else {
58 -                       input.addClass( "ui-corner-all ui-shadow-inset" + themeclass + miniclass );
59 -               }
60 -
61                 input.focus(function() {
62                                 focusedEl.addClass( $.mobile.focusClass );
63                         })
64 @@ -141,10 +109,10 @@ $.widget( "mobile.textinput", $.mobile.widget, {
65  
66         disable: function() {
67                 var $el;
68 -               if ( this.element.attr( "disabled", true ).is( "[type='search'], :jqmData(type='search')" ) ) {
69 -                       $el = this.element.parent();
70 -               } else {
71 +               if ( this.element.attr( "disabled", true ) ) {
72                         $el = this.element;
73 +               } else {
74 +                       return;
75                 }
76                 $el.addClass( "ui-disabled" );
77                 return this._setOption( "disabled", true );
78 @@ -154,10 +122,10 @@ $.widget( "mobile.textinput", $.mobile.widget, {
79                 var $el;
80  
81                 // TODO using more than one line of code is acceptable ;)
82 -               if ( this.element.attr( "disabled", false ).is( "[type='search'], :jqmData(type='search')" ) ) {
83 -                       $el = this.element.parent();
84 -               } else {
85 +               if ( this.element.attr( "disabled", false ) ) {
86                         $el = this.element;
87 +               } else {
88 +                       return;
89                 }
90                 $el.removeClass( "ui-disabled" );
91                 return this._setOption( "disabled", false );
92 -- 
93 1.7.9.5
94