scrollview: add function for getting width of view
authorMinkyu Kang <mk7.kang@samsung.com>
Fri, 22 Feb 2013 08:29:04 +0000 (17:29 +0900)
committerYoumin Ha <youmin.ha@samsung.com>
Thu, 7 Mar 2013 12:10:31 +0000 (21:10 +0900)
The virtual grid needs this function for setting width of view

Change-Id: I3ab619a22a80eb39fbd130bda9b48fc04bbfbdfe

src/js/jquery.mobile.tizen.scrollview.js

index cadff6d..a82745c 100644 (file)
@@ -76,6 +76,10 @@ define( [ ], function ( ) {
                        return this._$view.height();
                },
 
+               _getViewWidth: function () {
+                       return this._$view.width();
+               },
+
                _makePositioned: function ( $ele ) {
                        if ( $ele.css("position") === "static" ) {
                                $ele.css( "position", "relative" );
@@ -144,7 +148,7 @@ define( [ ], function ( ) {
 
                        if ( ht ) {
                                c = this._$clip.width();
-                               v = this._$view.width();
+                               v = this._getViewWidth();
 
                                if ( (( this._sx === 0 && speedX > 0 ) ||
                                        ( this._sx === -(v - c) && speedX < 0 )) &&
@@ -862,7 +866,7 @@ define( [ ], function ( ) {
                                        this.scrollTo( 0, this._sy, this.options.overshootDuration );
                                        break;
                                case direction.right:
-                                       this.scrollTo( -( this._$view.width() - this._$clip.width() ), this._sy,
+                                       this.scrollTo( -( this._getViewWidth() - this._$clip.width() ), this._sy,
                                                        this.options.overshootDuration );
                                        break;
                                }