Skip to content

Commit

Permalink
Safari fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bfiessinger authored Feb 13, 2020
1 parent a0572a0 commit f9384f8
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions changelog.MD
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- Call destroy method on initialization to prevent errors with existing ones
- Added a update Method to edit settings after initialization
- Bugfix: links where not collected correctly in Internet Explorer
- Bugfix: window.performance fix on old Safari's
- Remove Deprecated warnings
- cleaned up some functions

Expand Down
4 changes: 3 additions & 1 deletion dist/scrolltosmooth.js
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,9 @@ var scrollToSmooth = (function() {
*/

var getTime = function getTime() {
return "now" in w.performance ? performance.now() : new Date().getTime();
return w.performance && "now" in w.performance
? performance.now()
: new Date().getTime();
};
/**
* Determine element baseURI
Expand Down
2 changes: 1 addition & 1 deletion dist/scrolltosmooth.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/scrolltosmooth.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export default class scrollToSmooth {
/**
* Get the current Timestamp
*/
let getTime = () => 'now' in w.performance ? performance.now() : new Date().getTime();
let getTime = () => (w.performance && 'now' in w.performance) ? performance.now() : new Date().getTime();

/**
* Determine element baseURI
Expand Down

0 comments on commit f9384f8

Please sign in to comment.