Fastscroll: Add 'orientationchange' event handler.
authorMinkyeong Kim <minkyeong.kim@samsung.com>
Tue, 23 Apr 2013 05:04:00 +0000 (14:04 +0900)
committerhjnim.kim <hjnim.kim@samsung.com>
Fri, 3 May 2013 06:29:06 +0000 (15:29 +0900)
Resolves #N_SE-35655, #N_SE-35660, #N_SE-35671.

Change-Id: I0997eb813f162047536cd257011cd03b72037d41

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

index a9f9d53..7642201 100644 (file)
@@ -115,7 +115,7 @@ define( [ '../jquery.mobile.tizen.scrollview' ], function ( ) {
                                page = $el.closest( ':jqmData(role="page")' ),
                                jumpToDivider;
 
-                       this.scrollview = $el.closest( '.ui-scrollview-clip' );
+                       this.scrollview = $el.addClass( 'ui-fastscroll-target' ).closest( '.ui-scrollview-clip' );
                        this.shortcutsContainer = $( '<div class="ui-fastscroll" aria-label="Fast scroll bar, double tap to fast scroll mode" tabindex="0"/>' );
                        this.shortcutsList = $( '<ul aria-hidden="true"></ul>' );
 
@@ -244,10 +244,6 @@ define( [ '../jquery.mobile.tizen.scrollview' ], function ( ) {
                                self.refresh();
                        } );
 
-                       $( window ).unbind( ".fastscroll" ).bind( "resize.fastscroll", function ( e ) {
-                               self.refresh();
-                       } );
-
                        self.scrollview.bind( "scrollstart", function ( e ) {
                                self._setTimer( false );
                        }).bind( "scrollstop", function ( e ) {
@@ -659,6 +655,9 @@ define( [ '../jquery.mobile.tizen.scrollview' ], function ( ) {
                        .fastscroll();
        } );
 
+       $( window ).bind( "resize orientationchange", function ( e ) {
+               $( ".ui-page-active .ui-fastscroll-target" ).fastscroll( "refresh" );
+       } );
 } ( jQuery ) );
 
 //>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude);