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-5.1.1 node_modules/@fancyapps/fancybox/src/js/wheel.js
promethee-5.1.0 node_modules/@fancyapps/fancybox/src/js/wheel.js
promethee-5.0.2 node_modules/@fancyapps/fancybox/src/js/wheel.js
promethee-5.0.1 node_modules/@fancyapps/fancybox/src/js/wheel.js
promethee-5.0.0 node_modules/@fancyapps/fancybox/src/js/wheel.js
promethee-4.1.28 node_modules/@fancyapps/fancybox/src/js/wheel.js
promethee-4.1.27 node_modules/@fancyapps/fancybox/src/js/wheel.js
promethee-4.1.26 node_modules/@fancyapps/fancybox/src/js/wheel.js
promethee-4.1.25 node_modules/@fancyapps/fancybox/src/js/wheel.js
promethee-4.1.24 node_modules/@fancyapps/fancybox/src/js/wheel.js
promethee-4.1.23 node_modules/@fancyapps/fancybox/src/js/wheel.js
promethee-4.1.22 node_modules/@fancyapps/fancybox/src/js/wheel.js
promethee-4.1.21 node_modules/@fancyapps/fancybox/src/js/wheel.js
promethee-4.1.20 node_modules/@fancyapps/fancybox/src/js/wheel.js
promethee-4.1.19 node_modules/@fancyapps/fancybox/src/js/wheel.js
promethee-4.1.18 node_modules/@fancyapps/fancybox/src/js/wheel.js
promethee-4.1.17 node_modules/@fancyapps/fancybox/src/js/wheel.js
promethee-4.1.16 node_modules/@fancyapps/fancybox/src/js/wheel.js
promethee-4.1.15 node_modules/@fancyapps/fancybox/src/js/wheel.js
promethee-4.1.14 node_modules/@fancyapps/fancybox/src/js/wheel.js