Commit e6c500d 1 parent 1fffd8b commit e6c500d Copy full SHA for e6c500d
File tree 2 files changed +10
-3
lines changed
2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " scroll-to-element" ,
3
3
"description" : " Smooth scrolling to an element via selector or node reference" ,
4
- "version" : " 2.0.2 " ,
4
+ "version" : " 2.0.3 " ,
5
5
"author" : {
6
6
"name" : " Will Hoag" ,
7
7
Original file line number Diff line number Diff line change 1
1
var ease = require ( './ease' ) ;
2
2
var Emitter = require ( './emitter' ) ;
3
3
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
+
4
11
function Tween ( obj ) {
5
12
if ( ! ( this instanceof Tween ) ) return new Tween ( obj ) ;
6
13
this . _from = obj ;
@@ -12,7 +19,7 @@ Emitter(Tween.prototype);
12
19
13
20
Tween . prototype . reset = function ( ) {
14
21
this . isArray = Object . prototype . toString . call ( this . _from ) === '[object Array]' ;
15
- this . _curr = Object . assign ( { } , this . _from ) ;
22
+ this . _curr = extend ( { } , this . _from ) ;
16
23
this . _done = false ;
17
24
this . _start = Date . now ( ) ;
18
25
return this ;
@@ -90,4 +97,4 @@ Tween.prototype.update = function(fn){
90
97
return this ;
91
98
} ;
92
99
93
- module . exports = Tween ;
100
+ module . exports = Tween ;
You can’t perform that action at this time.
0 commit comments