Avoid 'recalculate style' by conditionally change classes while scrolling

Change-Id: I71b42f9f974a1367700283ad55013e9e6a036827
This commit is contained in:
Santhosh Thottingal
2013-11-01 11:08:15 +05:30
parent a985d33d4b
commit 5444e17727

View File

@@ -301,9 +301,12 @@
}
} );
// highlight the region visible while scrolling in the map.
inview = $.uls.data.regiongroups[inviewRegion];
$( '.regionselector' ).removeClass( 'active' );
$( '#uls-region-' + inview ).addClass( 'active' );
if ( !$( '#uls-region-' + inview ).hasClass( 'active' ) ) {
$( '.regionselector' ).removeClass( 'active' );
$( '#uls-region-' + inview ).addClass( 'active' );
}
} );
}
};