Skip to content

Commit e6c500d

Browse files
committed
remove Object.assign for IE11 compatibility
1 parent 1fffd8b commit e6c500d

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "scroll-to-element",
33
"description": "Smooth scrolling to an element via selector or node reference",
4-
"version": "2.0.2",
4+
"version": "2.0.3",
55
"author": {
66
"name": "Will Hoag",
77
"email": "[email protected]"

tween.js

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
var ease = require('./ease');
22
var Emitter = require('./emitter');
33

4+
function extend(obj, src) {
5+
for (var key in src) {
6+
if (src.hasOwnProperty(key)) obj[key] = src[key];
7+
}
8+
return obj;
9+
}
10+
411
function Tween(obj) {
512
if (!(this instanceof Tween)) return new Tween(obj);
613
this._from = obj;
@@ -12,7 +19,7 @@ Emitter(Tween.prototype);
1219

1320
Tween.prototype.reset = function(){
1421
this.isArray = Object.prototype.toString.call(this._from) === '[object Array]';
15-
this._curr = Object.assign({}, this._from);
22+
this._curr = extend({}, this._from);
1623
this._done = false;
1724
this._start = Date.now();
1825
return this;
@@ -90,4 +97,4 @@ Tween.prototype.update = function(fn){
9097
return this;
9198
};
9299

93-
module.exports = Tween;
100+
module.exports = Tween;

0 commit comments

Comments
 (0)