Sha256: 2c8c58ded9b44e4d3af93a77d51eb077db7193c20a00404abf76f751429d758c

Contents?: true

Size: 1.16 KB

Versions: 106

Compression:

Stored size: 1.16 KB

Contents

// ==========================================================================
//
// Wheel
// Basic mouse weheel support for gallery navigation
//
// ==========================================================================
(function(document, $) {
  "use strict";

  var prevTime = new Date().getTime();

  $(document).on({
    "onInit.fb": function(e, instance, current) {
      instance.$refs.stage.on("mousewheel DOMMouseScroll wheel MozMousePixelScroll", function(e) {
        var current = instance.current,
          currTime = new Date().getTime();

        if (instance.group.length < 2 || current.opts.wheel === false || (current.opts.wheel === "auto" && current.type !== "image")) {
          return;
        }

        e.preventDefault();
        e.stopPropagation();

        if (current.$slide.hasClass("fancybox-animated")) {
          return;
        }

        e = e.originalEvent || e;

        if (currTime - prevTime < 250) {
          return;
        }

        prevTime = currTime;

        instance[(-e.deltaY || -e.deltaX || e.wheelDelta || -e.detail) < 0 ? "next" : "previous"]();
      });
    }
  });
})(document, jQuery);

Version data entries

106 entries across 106 versions & 1 rubygems

Version Path
promethee-4.1.13 node_modules/@fancyapps/fancybox/src/js/wheel.js
promethee-4.1.12 node_modules/@fancyapps/fancybox/src/js/wheel.js
promethee-4.1.11 node_modules/@fancyapps/fancybox/src/js/wheel.js
promethee-4.1.10 node_modules/@fancyapps/fancybox/src/js/wheel.js
promethee-4.1.9 node_modules/@fancyapps/fancybox/src/js/wheel.js
promethee-4.1.8 node_modules/@fancyapps/fancybox/src/js/wheel.js
promethee-4.1.7 node_modules/@fancyapps/fancybox/src/js/wheel.js
promethee-4.1.6 node_modules/@fancyapps/fancybox/src/js/wheel.js
promethee-4.1.5 node_modules/@fancyapps/fancybox/src/js/wheel.js
promethee-4.1.4 node_modules/@fancyapps/fancybox/src/js/wheel.js
promethee-4.1.3 node_modules/@fancyapps/fancybox/src/js/wheel.js
promethee-4.1.2 node_modules/@fancyapps/fancybox/src/js/wheel.js
promethee-4.1.1 node_modules/@fancyapps/fancybox/src/js/wheel.js
promethee-4.1.0 node_modules/@fancyapps/fancybox/src/js/wheel.js
promethee-4.0.8 node_modules/@fancyapps/fancybox/src/js/wheel.js
promethee-4.0.7 node_modules/@fancyapps/fancybox/src/js/wheel.js
promethee-4.0.6 node_modules/@fancyapps/fancybox/src/js/wheel.js
promethee-4.0.5 node_modules/@fancyapps/fancybox/src/js/wheel.js
promethee-4.0.4 node_modules/@fancyapps/fancybox/src/js/wheel.js
promethee-4.0.3 node_modules/@fancyapps/fancybox/src/js/wheel.js