Skip to content

Commit

Permalink
Merge pull request #3489 from quochuy/mousewheelevents
Browse files Browse the repository at this point in the history
Support to 'wheel' event listener
  • Loading branch information
hakimel authored Oct 27, 2023
2 parents cc640a2 + 68efdf6 commit adfa346
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/reveal.esm.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/reveal.js.map

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion js/controllers/pointer.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ export default class Pointer {
if( config.mouseWheel ) {
document.addEventListener( 'DOMMouseScroll', this.onDocumentMouseScroll, false ); // FF
document.addEventListener( 'mousewheel', this.onDocumentMouseScroll, false );
document.addEventListener( 'wheel', this.onDocumentMouseScroll, false );
}
else {
document.removeEventListener( 'DOMMouseScroll', this.onDocumentMouseScroll, false ); // FF
document.removeEventListener( 'mousewheel', this.onDocumentMouseScroll, false );
document.removeEventListener( 'wheel', this.onDocumentMouseScroll, false );
}

// Auto-hide the mouse pointer when its inactive
Expand Down Expand Up @@ -81,6 +83,7 @@ export default class Pointer {

document.removeEventListener( 'DOMMouseScroll', this.onDocumentMouseScroll, false );
document.removeEventListener( 'mousewheel', this.onDocumentMouseScroll, false );
document.removeEventListener( 'wheel', this.onDocumentMouseScroll, false );
document.removeEventListener( 'mousemove', this.onDocumentCursorActive, false );
document.removeEventListener( 'mousedown', this.onDocumentCursorActive, false );

Expand Down Expand Up @@ -126,4 +129,4 @@ export default class Pointer {

}

}
}

0 comments on commit adfa346

Please sign in to comment.