searchbar: fix jslint errors
authorMinkyu Kang <mk7.kang@samsung.com>
Thu, 24 Jan 2013 03:47:51 +0000 (12:47 +0900)
committerYoumin Ha <youmin.ha@samsung.com>
Thu, 24 Jan 2013 11:50:14 +0000 (20:50 +0900)
'toggleClear' was used before it was defined.
toggleClear(); // Line 145, Pos 13
'makeFrontIcon' was used before it was defined.
makeFrontIcon(); // Line 154, Pos 17
'hideCancel' was used before it was defined.
hideCancel(); // Line 172, Pos 29
'showCancel' was used before it was defined.
showCancel(); // Line 190, Pos 25
'toggleClear' was used before it was defined.
function toggleClear() { // Line 242, Pos 22
Expected 'cancelbtn' at column 17, not column 21.
cancelbtn // Line 252, Pos 21
Expected 'cancelbtn' at column 17, not column 21.
cancelbtn // Line 261, Pos 21
'makeFrontIcon' was used before it was defined.
function makeFrontIcon() { // Line 267, Pos 22
Expected ';' and instead saw '$'.
this.element.parent().parent().find(".ui-input-cancel").removeClass( "ui-disabled" ) // Line 292, Pos 97

Change-Id: Ia4dcae9bb0b267da5fba108d28d4b56a6bb8c436

src/widgets/searchbar/js/jquery.mobile.tizen.searchbar.js

index 6a134c4..8ad0bd3 100755 (executable)
 
                        $( "label[for='" + input.attr( "id" ) + "']" ).addClass( "ui-input-text" );
 
-//                     focusedEl = input.addClass( "ui-input-text ui-body-" + theme );
-
                        if ( typeof input[0].autocorrect !== "undefined" && !$.support.touchOverflow ) {
                                // Set the attribute instead of the property just in case there
                                // is code that attempts to make modifications via HTML.
                                        shadow: true
                                });
 
+                       function toggleClear() {
+                               setTimeout(function () {
+                                       clearbtn.toggleClass( "ui-input-clear-hidden", !input.val() );
+                               }, 0);
+                       }
+
+                       function showCancel() {
+                               focusedEl
+                                       .addClass( "ui-input-search-default" )
+                                       .removeClass( "ui-input-search-wide" );
+                               cancelbtn
+                                       .addClass( "ui-btn-cancel-show" )
+                                       .removeClass( "ui-btn-cancel-hide" );
+                       }
+
+                       function hideCancel() {
+                               focusedEl
+                                       .addClass( "ui-input-search-wide" )
+                                       .removeClass( "ui-input-search-default" );
+                               cancelbtn
+                                       .addClass( "ui-btn-cancel-hide" )
+                                       .removeClass( "ui-btn-cancel-show" );
+                               toggleClear();
+                       }
+
+                       function makeFrontIcon() {
+                               var IconStyle = $( input ).jqmData( "icon" ),
+                                       frontIcon = $( "<div data-role='button' data-style='circle'></div>" );
+
+                               frontIcon
+                                       .appendTo( focusedEl.parent() )
+                                       .buttonMarkup( {
+                                               icon: IconStyle,
+                                               corners: true,
+                                               shadow: true
+                                       } );
+                               frontIcon.addClass( "ui-btn-search-front-icon" );
+                       }
+
                        toggleClear();
 
                        input.bind( 'paste cut keyup focus change blur', toggleClear );
                        if ( !input.attr("placeholder") ) {
                                input.attr( "placeholder", "Search" );
                        }
-
-                       function toggleClear() {
-                               setTimeout(function () {
-                                       clearbtn.toggleClass( "ui-input-clear-hidden", !input.val() );
-                               }, 0);
-                       }
-
-                       function showCancel() {
-                               focusedEl
-                                       .addClass( "ui-input-search-default" )
-                                       .removeClass( "ui-input-search-wide" );
-                                       cancelbtn
-                                               .addClass( "ui-btn-cancel-show" )
-                                               .removeClass( "ui-btn-cancel-hide" );
-                       }
-
-                       function hideCancel() {
-                               focusedEl
-                                       .addClass( "ui-input-search-wide" )
-                                       .removeClass( "ui-input-search-default" );
-                                       cancelbtn
-                                               .addClass( "ui-btn-cancel-hide" )
-                                               .removeClass( "ui-btn-cancel-show" );
-                               toggleClear();
-                       }
-
-                       function makeFrontIcon() {
-                               var IconStyle = $( input ).jqmData( "icon" ),
-                                       frontIcon = $( "<div data-role='button' data-style='circle'></div>" );
-
-                               frontIcon
-                                       .appendTo( focusedEl.parent() )
-                                       .buttonMarkup( {
-                                               icon: IconStyle,
-                                               corners: true,
-                                               shadow: true
-                                       } );
-                               frontIcon.addClass( "ui-btn-search-front-icon" );
-                       }
                },
 
                disable: function () {
                enable: function () {
                        this.element.attr( "disabled", false );
                        this.element.parent().removeClass( "ui-disabled" );
-                       this.element.parent().parent().find(".ui-input-cancel").removeClass( "ui-disabled" )
+                       this.element.parent().parent().find(".ui-input-cancel").removeClass( "ui-disabled" );
                        $( this.element ).focus();
                }
        } );