virtualgrid: Fix jslint errors
authorWoosung Sohn <woosungim.sohn@samsung.com>
Wed, 23 Jan 2013 09:37:17 +0000 (18:37 +0900)
committerMinkyu Kang <mk7.kang@samsung.com>
Wed, 23 Jan 2013 11:05:18 +0000 (20:05 +0900)
Change-Id: Ic82a5ef880191820900c5fbd105c91b9bd10027b

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

index 7b0b5e6..6b5e69e 100644 (file)
                        var $target = $(elem),
                                height,
                                width,
+                               NODETYPE = { ELEMENT_NODE : 1, TEXT_NODE : 3 },
                                ret = {
                                        isDefinedWidth : false,
                                        isDefinedHeight : false,
                                        height : 0
                                };
 
-                       while ( $target[0].nodeType === Node.ELEMENT_NODE && (ret.isDefinedWidth === false || ret.isHeightDefined === false )) {
+                       while ( $target[0].nodeType === NODETYPE.ELEMENT_NODE && (ret.isDefinedWidth === false || ret.isHeightDefined === false )) {
                                height = $target[0].style.height;
                                width = $target[0].style.width;
 
                // @param newItem   : new HtmlDivElement for replace
                // @param key       :
                _replace : function ( oldItem, newItem, key ) {
+                       var NODETYPE = { ELEMENT_NODE : 1, TEXT_NODE : 3 };
+
                        $( oldItem ).find( ".ui-li-text-main", ".ui-li-text-sub", "ui-btn-text" ).each( function ( index ) {
                                var oldObj = $( this ),
                                        newText = $( newItem ).find( ".ui-li-text-main", ".ui-li-text-sub", "ui-btn-text" ).eq( index ).text();
 
                                $( oldObj ).contents().filter( function () {
-                                       return ( this.nodeType == 3 );
+                                       return ( this.nodeType == NODETYPE.TEXT_NODE );
                                }).get( 0 ).data = newText;
                        });