Skip to content

Commit 4eec476

Browse files
committed
Updated version number
1 parent abc62e8 commit 4eec476

File tree

7 files changed

+48
-41
lines changed

7 files changed

+48
-41
lines changed

dist/smooth-scroll.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* smooth-scroll v16.1.2
2+
* smooth-scroll v16.1.4
33
* Animate scrolling to anchor links
44
* (c) 2020 Chris Ferdinandi
55
* MIT License
@@ -189,8 +189,8 @@
189189
/**
190190
* Calculate the easing pattern
191191
* @link https://gist.github.com/gre/1650294
192-
* @param {String} type Easing pattern
193-
* @param {Number} time Time animation should take to complete
192+
* @param {Object} settings Easing pattern
193+
* @param {Number} time Time animation should take to complete
194194
* @returns {Number}
195195
*/
196196
var easingPattern = function (settings, time) {
@@ -488,7 +488,7 @@
488488

489489
// If the user prefers reduced motion, jump to location
490490
if (reduceMotion()) {
491-
window.scrollTo(0, Math.floor(endLocation));
491+
adjustFocus(anchor, Math.floor(endLocation), false);
492492
return;
493493
}
494494

@@ -553,7 +553,7 @@
553553
/**
554554
* Animate scroll on popstate events
555555
*/
556-
var popstateHandler = function (event) {
556+
var popstateHandler = function () {
557557

558558
// Stop if history.state doesn't exist (ex. if clicking on a broken anchor link).
559559
// fixes `Cannot read property 'smoothScroll' of null` error getting thrown.
@@ -562,10 +562,6 @@
562562
// Only run if state is a popstate record for this instantiation
563563
if (!history.state.smoothScroll || history.state.smoothScroll !== JSON.stringify(settings)) return;
564564

565-
// Only run if state includes an anchor
566-
567-
// if (!history.state.anchor && history.state.anchor !== 0) return;
568-
569565
// Get the anchor
570566
var anchor = history.state.anchor;
571567
if (typeof anchor === 'string' && anchor) {

dist/smooth-scroll.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/smooth-scroll.polyfills.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* smooth-scroll v16.1.2
2+
* smooth-scroll v16.1.4
33
* Animate scrolling to anchor links
44
* (c) 2020 Chris Ferdinandi
55
* MIT License
@@ -259,8 +259,8 @@ if (window.Element && !Element.prototype.closest) {
259259
/**
260260
* Calculate the easing pattern
261261
* @link https://gist.github.com/gre/1650294
262-
* @param {String} type Easing pattern
263-
* @param {Number} time Time animation should take to complete
262+
* @param {Object} settings Easing pattern
263+
* @param {Number} time Time animation should take to complete
264264
* @returns {Number}
265265
*/
266266
var easingPattern = function (settings, time) {
@@ -558,7 +558,7 @@ if (window.Element && !Element.prototype.closest) {
558558

559559
// If the user prefers reduced motion, jump to location
560560
if (reduceMotion()) {
561-
window.scrollTo(0, Math.floor(endLocation));
561+
adjustFocus(anchor, Math.floor(endLocation), false);
562562
return;
563563
}
564564

@@ -623,7 +623,7 @@ if (window.Element && !Element.prototype.closest) {
623623
/**
624624
* Animate scroll on popstate events
625625
*/
626-
var popstateHandler = function (event) {
626+
var popstateHandler = function () {
627627

628628
// Stop if history.state doesn't exist (ex. if clicking on a broken anchor link).
629629
// fixes `Cannot read property 'smoothScroll' of null` error getting thrown.
@@ -632,10 +632,6 @@ if (window.Element && !Element.prototype.closest) {
632632
// Only run if state is a popstate record for this instantiation
633633
if (!history.state.smoothScroll || history.state.smoothScroll !== JSON.stringify(settings)) return;
634634

635-
// Only run if state includes an anchor
636-
637-
// if (!history.state.anchor && history.state.anchor !== 0) return;
638-
639635
// Get the anchor
640636
var anchor = history.state.anchor;
641637
if (typeof anchor === 'string' && anchor) {

0 commit comments

Comments
 (0)