From 1c49c855b402994c1144a5290e29be868f448cc7 Mon Sep 17 00:00:00 2001 From: Rouslan Placella Date: Wed, 19 Dec 2012 12:41:18 +0000 Subject: [PATCH] Updated mousewheel plugin to v3.0.6 --- js/jquery/jquery.mousewheel.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) mode change 100644 => 100755 js/jquery/jquery.mousewheel.js diff --git a/js/jquery/jquery.mousewheel.js b/js/jquery/jquery.mousewheel.js old mode 100644 new mode 100755 index 3e2710fcbc8e..38b60951b201 --- a/js/jquery/jquery.mousewheel.js +++ b/js/jquery/jquery.mousewheel.js @@ -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+ */ @@ -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 ) { @@ -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; @@ -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);