From 198e11c59b9f5db703495a6b33f200930fd00372 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 27 Jan 2012 17:33:01 +0530 Subject: [PATCH] update jquery.mousewheel.js to work with jquery 1.7 --- source/Ox.UI/jquery/jquery.mousewheel.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) mode change 100755 => 100644 source/Ox.UI/jquery/jquery.mousewheel.js diff --git a/source/Ox.UI/jquery/jquery.mousewheel.js b/source/Ox.UI/jquery/jquery.mousewheel.js old mode 100755 new mode 100644 index b7932415..38b60951 --- a/source/Ox.UI/jquery/jquery.mousewheel.js +++ b/source/Ox.UI/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); \ No newline at end of file +})(jQuery);