File tree Expand file tree Collapse file tree 1 file changed +18
-8
lines changed Expand file tree Collapse file tree 1 file changed +18
-8
lines changed Original file line number Diff line number Diff line change 2901
2901
refreshId : null ,
2902
2902
iScrollInstances : [ ] ,
2903
2903
2904
+ // Enables or disables the mouse wheel for the active section or all slides in it
2905
+ toggleWheel : function ( value ) {
2906
+ var scrollable = $ ( SECTION_ACTIVE_SEL ) . find ( SCROLLABLE_SEL ) ;
2907
+ scrollable . each ( function ( ) {
2908
+ var iScrollInstance = $ ( this ) . data ( 'iscrollInstance' ) ;
2909
+ if ( typeof iScrollInstance !== 'undefined' && iScrollInstance ) {
2910
+ if ( value ) {
2911
+ iScrollInstance . wheelOn ( ) ;
2912
+ }
2913
+ else {
2914
+ iScrollInstance . wheelOff ( ) ;
2915
+ }
2916
+ }
2917
+ } ) ;
2918
+ } ,
2919
+
2904
2920
/**
2905
2921
* Turns off iScroll for the destination section.
2906
2922
* When scrolling very fast on some trackpads (and Apple laptops) the inertial scrolling would
2907
2923
* scroll the destination section/slide before the sections animations ends.
2908
2924
*/
2909
2925
onLeave : function ( ) {
2910
- var scroller = $ ( SECTION_ACTIVE_SEL ) . find ( SCROLLABLE_SEL ) . data ( 'iscrollInstance' ) ;
2911
- if ( typeof scroller !== 'undefined' && scroller ) {
2912
- scroller . wheelOff ( ) ;
2913
- }
2926
+ iscrollHandler . toggleWheel ( false ) ;
2914
2927
} ,
2915
2928
2916
2929
// Turns off iScroll for the leaving section
2920
2933
2921
2934
// Turns on iScroll on section load
2922
2935
afterLoad : function ( ) {
2923
- var scroller = $ ( SECTION_ACTIVE_SEL ) . find ( SCROLLABLE_SEL ) . data ( 'iscrollInstance' ) ;
2924
- if ( typeof scroller !== 'undefined' && scroller ) {
2925
- scroller . wheelOn ( ) ;
2926
- }
2936
+ iscrollHandler . toggleWheel ( true ) ;
2927
2937
} ,
2928
2938
2929
2939
/**
You can’t perform that action at this time.
0 commit comments