scrollview: fix focusen on element on window resize (N_SE-41303, N_SE-41364)
authorMaciej Urbanski <m.urbanski@samsung.com>
Fri, 14 Jun 2013 14:17:56 +0000 (16:17 +0200)
committerheeju.joo <heeju.joo@samsung.com>
Wed, 10 Jul 2013 02:10:20 +0000 (11:10 +0900)
Change to wrong scrollTo to one scrollTo with cache new position in variables.

Change-Id: I3458597d56313691ec566ae89da34f51ba545570

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

index 04e0117..940a800 100644 (file)
@@ -1490,15 +1490,20 @@ define( [ ], function ( ) {
 
                                /* calibration - after triggered throttledresize */
                                setTimeout( function () {
-                                       var view_w = self._getViewWidth(),
-                                               cw = $c.width();
+                                       var view_w = $v.outerWidth(),
+                                               cw = $c.outerWidth(),
+                                               scroll_x,
+                                               scroll_y;
                                        if ( self._sy < $c.height() - self._getViewHeight() ) {
-                                               self.scrollTo( 0, $c.height() - self._getViewHeight(),
-                                                       self.options.overshootDuration );
+                                               scroll_y = $c.height() - self._getViewHeight();
+                                               scroll_x = 0;
                                        }
                                        if ( self._sx < cw - view_w ) {
-                                               self.scrollTo( cw - view_w, 0,
-                                                       self.options.overshootDuration );
+                                               scroll_x = cw - view_w;
+                                               scroll_y = scroll_y || 0;
+                                       }
+                                       if (scroll_x || scroll_y) {
+                                               self.scrollTo( scroll_x, scroll_y, self.options.overshootDuration );
                                        }
                                }, 260 );