/*! Copyright (c) 2013 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.1.1
 *
 * Requires: 1.2.2+
 */

(function (factory) {
    if (typeof define === 'function' && define.amd) {
        // AMD. Register as an anonymous module.
        define(['jquery'], factory);
    } else {
        // Browser globals
        factory(jQuery);
    }
}(function ($) {

    var toFix = ['wheel', 'mousewheel', 'DOMMouseScroll'];
    var toBind = 'onwheel' in document || document.documentMode >= 9 ? ['wheel'] : ['mousewheel', 'DomMouseScroll', 'MozMousePixelScroll'];
    var lowestDelta, lowestDeltaXY;

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

    $.event.special.mousewheel = {
        setup: function() {
            if ( this.addEventListener ) {
                for ( var i=toBind.length; i; ) {
                    this.addEventListener( toBind[--i], handler, false );
                }
            } else {
                this.onmousewheel = handler;
            }
        },

        teardown: function() {
            if ( this.removeEventListener ) {
                for ( var i=toBind.length; i; ) {
                    this.removeEventListener( toBind[--i], handler, false );
                }
            } else {
                this.onmousewheel = null;
            }
        }
    };

    $.fn.extend({
        mousewheel: function(fn) {
            return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel");
        },

        unmousewheel: function(fn) {
            return this.unbind("mousewheel", fn);
        }
    });


    function handler(event) {
        var orgEvent = event || window.event, args = [].slice.call( arguments, 1 ), delta = 0, deltaX = 0, deltaY = 0, absDelta = 0, absDeltaXY = 0, fn;
        event = $.event.fix(orgEvent);
        event.type = "mousewheel";

        // Old school scrollwheel delta
        if ( orgEvent.wheelDelta ) { delta = orgEvent.wheelDelta;  }
        if ( orgEvent.detail     ) { delta = orgEvent.detail * -1; }

        // New school wheel delta (wheel event)
        if ( orgEvent.deltaY ) {
            deltaY = orgEvent.deltaY * -1;
            delta  = deltaY;
        }
        if ( orgEvent.deltaX ) {
            deltaX = orgEvent.deltaX;
            delta  = deltaX * -1;
        }

        // Webkit
        if ( orgEvent.wheelDeltaY !== undefined ) { deltaY = orgEvent.wheelDeltaY;      }
        if ( orgEvent.wheelDeltaX !== undefined ) { deltaX = orgEvent.wheelDeltaX * -1; }

        // Look for lowest delta to normalize the delta values
        absDelta = Math.abs(delta);
        if ( !lowestDelta || absDelta < lowestDelta ) { lowestDelta = absDelta; }
        absDeltaXY = Math.max( Math.abs(deltaY), Math.abs(deltaX) );
        if ( !lowestDeltaXY || absDeltaXY < lowestDeltaXY ) { lowestDeltaXY = absDeltaXY; }

        // Get a whole value for the deltas
        fn = delta > 0 ? 'floor' : 'ceil';
        delta  = Math[fn](delta/lowestDelta);
        deltaX = Math[fn](deltaX/lowestDeltaXY);
        deltaY = Math[fn](deltaY/lowestDeltaXY);

        // Add event and delta to the front of the arguments
        args.unshift(event, delta, deltaX, deltaY);

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

}));

@@ -334,17 +334,17 @@
 on: 3.1.
-1
+3
 %0A *%0A * R
@@ -394,16 +394,17 @@
     if (
+ 
 typeof d
@@ -437,16 +437,17 @@
 fine.amd
+ 
 ) %7B%0A    
@@ -524,24 +524,150 @@
 , factory);%0A
+    %7D else if (typeof exports === 'object') %7B%0A        // Node/CommonJS style for Browserify%0A        module.exports = factory;%0A
     %7D else %7B
@@ -795,24 +795,47 @@
 MouseScroll'
+, 'MozMousePixelScroll'
 %5D;%0A    var t
@@ -1010,16 +1010,17 @@
     if (
+ 
 $.event.
@@ -1027,16 +1027,17 @@
 fixHooks
+ 
 ) %7B%0A    
@@ -1051,17 +1051,19 @@
  ( var i
-=
+ = 
 toFix.le
@@ -1282,33 +1282,35 @@
      for ( var i
-=
+ = 
 toBind.length; i
@@ -1603,17 +1603,19 @@
  ( var i
-=
+ = 
 toBind.l
@@ -2147,16 +2147,28 @@
 w.event,
+%0A           
  args = 
@@ -2181,17 +2181,16 @@
 ce.call(
- 
 argument
@@ -2197,46 +2197,93 @@
 s, 1
- 
 ),
- delta = 0, deltaX = 0, deltaY = 0,
+%0A            delta = 0,%0A            deltaX = 0,%0A            deltaY = 0,%0A           
  abs
@@ -2292,16 +2292,28 @@
 lta = 0,
+%0A           
  absDelt
@@ -2320,16 +2320,28 @@
 aXY = 0,
+%0A           
  fn;%0A   
@@ -2517,17 +2517,16 @@
 elDelta;
- 
  %7D%0A     
@@ -2553,13 +2553,13 @@
 ail 
+)
     
-)
  %7B d
@@ -2969,21 +2969,16 @@
 lDeltaY;
-     
  %7D%0A     
@@ -3274,17 +3274,16 @@
 ath.max(
- 
 Math.abs
@@ -3308,17 +3308,16 @@
 (deltaX)
- 
 );%0A     
@@ -3522,17 +3522,19 @@
 n%5D(delta
-/
+ / 
 lowestDe
@@ -3571,17 +3571,19 @@
 %5D(deltaX
-/
+ / 
 lowestDe
@@ -3622,17 +3622,19 @@
 %5D(deltaY
-/
+ / 
 lowestDe

update jquery.mousewheel.js to 3.1.3