Navigation Menu

Skip to content

Commit

Permalink
Updated mousewheel plugin to v3.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
roccivic committed Dec 19, 2012
1 parent ad6a9d1 commit 1c49c85
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions js/jquery/jquery.mousewheel.js 100644 → 100755
@@ -1,11 +1,11 @@
/*! Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
/*! Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net)
* Licensed under the MIT License (LICENSE.txt).
*
* Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
* Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
* Thanks to: Seamus Leahy for adding deltaX and deltaY
*
* Version: 3.0.4
* Version: 3.0.6
*
* Requires: 1.2.2+
*/
Expand All @@ -14,6 +14,12 @@

var types = ['DOMMouseScroll', 'mousewheel'];

if ($.event.fixHooks) {
for ( var i=types.length; i; ) {
$.event.fixHooks[ types[--i] ] = $.event.mouseHooks;
}
}

$.event.special.mousewheel = {
setup: function() {
if ( this.addEventListener ) {
Expand Down Expand Up @@ -53,8 +59,8 @@ function handler(event) {
event.type = "mousewheel";

// Old school scrollwheel delta
if ( event.wheelDelta ) { delta = event.wheelDelta/120; }
if ( event.detail ) { delta = -event.detail/3; }
if ( orgEvent.wheelDelta ) { delta = orgEvent.wheelDelta/120; }
if ( orgEvent.detail ) { delta = -orgEvent.detail/3; }

// New school multidimensional scroll (touchpads) deltas
deltaY = delta;
Expand All @@ -72,7 +78,7 @@ function handler(event) {
// Add event and delta to the front of the arguments
args.unshift(event, delta, deltaX, deltaY);

return $.event.handle.apply(this, args);
return ($.event.dispatch || $.event.handle).apply(this, args);
}

})(jQuery);

0 comments on commit 1c49c85

Please sign in to comment.