@invision-www/smooth-scroll
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -6,3 +6,3 @@ 'use strict'; | ||
function _load_scrollTo() { | ||
return _scrollTo = _interopRequireDefault(require('./scrollTo')); | ||
return _scrollTo = _interopRequireDefault(require('@invision-www/scroll-to')); | ||
} | ||
@@ -13,12 +13,12 @@ | ||
var handleMouseWheel = function handleMouseWheel(e) { | ||
e.preventDefault(); | ||
e.preventDefault(); | ||
var delta = e.wheelDelta / 120 || -e.detail / 3; | ||
var to = window.scrollY - parseInt(delta * 50, 10); | ||
var delta = e.wheelDelta / 120 || -e.detail / 3; | ||
var to = window.scrollY - parseInt(delta * 50, 10); | ||
(0, (_scrollTo || _load_scrollTo()).default)({ to: to, speed: 200 }); | ||
(0, (_scrollTo || _load_scrollTo()).default)({ to: to, speed: 200 }); | ||
}; | ||
['mousewheel', 'DOMMouseScroll'].map(function (evt) { | ||
return document.body.addEventListener(evt, handleMouseWheel); | ||
return document.body.addEventListener(evt, handleMouseWheel); | ||
}); |
{ | ||
"name": "@invision-www/smooth-scroll", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "", | ||
@@ -15,3 +15,6 @@ "main": "dist/smoothScroll.js", | ||
"author": "", | ||
"license": "ISC" | ||
"license": "ISC", | ||
"dependencies": { | ||
"@invision-www/scroll-to": "^1.0.3" | ||
} | ||
} |
@@ -1,12 +0,12 @@ | ||
import scrollTo from './scrollTo' | ||
import scrollTo from '@invision-www/scroll-to'; | ||
const handleMouseWheel = e => { | ||
e.preventDefault() | ||
e.preventDefault(); | ||
const delta = e.wheelDelta / 120 || -e.detail / 3 | ||
const to = window.scrollY - parseInt(delta * 50, 10) | ||
const delta = e.wheelDelta / 120 || -e.detail / 3; | ||
const to = window.scrollY - parseInt(delta * 50, 10); | ||
scrollTo({ to, speed: 200 }) | ||
} | ||
scrollTo({ to, speed: 200 }); | ||
}; | ||
['mousewheel', 'DOMMouseScroll'].map(evt => document.body.addEventListener(evt, handleMouseWheel)) | ||
['mousewheel', 'DOMMouseScroll'].map(evt => document.body.addEventListener(evt, handleMouseWheel)); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2288
1
+ Added@invision-www/scroll-to@1.0.8(transitive)
+ Addedeases@1.0.8(transitive)
+ Addedperformance-now@2.1.0(transitive)
+ Addedraf@3.4.1(transitive)