Skip to content

Commit

Permalink
mp: fix run tests
Browse files Browse the repository at this point in the history
  • Loading branch information
legomushroom committed Feb 22, 2015
1 parent 1cdc203 commit 75c504e
Show file tree
Hide file tree
Showing 14 changed files with 414 additions and 176 deletions.
14 changes: 7 additions & 7 deletions dist/mojs.js
Original file line number Diff line number Diff line change
Expand Up @@ -2246,14 +2246,14 @@ Timeline = (function() {
}
} else {
if (time >= this.props.endTime && !this.isCompleted) {
if ((_ref3 = this.o.onComplete) != null) {
_ref3.apply(this);
}
this.isCompleted = true;
this.setProc(1);
if (typeof this.onUpdate === "function") {
this.onUpdate(this.easedProgress);
}
if ((_ref3 = this.o.onComplete) != null) {
_ref3.apply(this);
}
this.isCompleted = true;
}
if (time > this.props.endTime || time < this.props.startTime) {
this.isFirstUpdate = false;
Expand Down Expand Up @@ -2991,12 +2991,12 @@ Tween = (function() {
}
this.prevTime = time;
if (time === this.props.endTime) {
if ((_ref1 = this.o.onComplete) != null) {
_ref1.apply(this);
}
if (typeof this.onUpdate === "function") {
this.onUpdate(1);
}
if ((_ref1 = this.o.onComplete) != null) {
_ref1.apply(this);
}
return true;
}
};
Expand Down
2 changes: 1 addition & 1 deletion dist/mojs.min.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions dist/timeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,14 @@ Timeline = (function() {
}
} else {
if (time >= this.props.endTime && !this.isCompleted) {
if ((_ref3 = this.o.onComplete) != null) {
_ref3.apply(this);
}
this.isCompleted = true;
this.setProc(1);
if (typeof this.onUpdate === "function") {
this.onUpdate(this.easedProgress);
}
if ((_ref3 = this.o.onComplete) != null) {
_ref3.apply(this);
}
this.isCompleted = true;
}
if (time > this.props.endTime || time < this.props.startTime) {
this.isFirstUpdate = false;
Expand Down
6 changes: 3 additions & 3 deletions dist/tween.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ Tween = (function() {
}
this.prevTime = time;
if (time === this.props.endTime) {
if ((_ref1 = this.o.onComplete) != null) {
_ref1.apply(this);
}
if (typeof this.onUpdate === "function") {
this.onUpdate(1);
}
if ((_ref1 = this.o.onComplete) != null) {
_ref1.apply(this);
}
return true;
}
};
Expand Down
4 changes: 2 additions & 2 deletions js/motion-path.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ class MotionPath
if o?.fill then @o.fill = o.fill
o and @extendDefaults o
o and @postVars(); it = @

@timeline = new Timeline
duration: @duration
delay: @delay
Expand All @@ -132,8 +133,7 @@ class MotionPath
onStart: => @onStart?()
onComplete: => @onComplete?()
onUpdate: (p)=> @setProgress p
@tween = new Tween; @tween.add @timeline
@tween.start()
@tween = new Tween; @tween.add(@timeline); @tween.start()

setProgress:(p)->
# o and @extendDefaults o
Expand Down
4 changes: 1 addition & 3 deletions js/timeline.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,11 @@ class Timeline
@onUpdate? @easedProgress
else
if time >= @props.endTime and !@isCompleted
(@o.onComplete?.apply(@); @isCompleted = true)
@setProc 1; @onUpdate? @easedProgress
@o.onComplete?.apply(@); @isCompleted = true
if time > @props.endTime or time < @props.startTime
@isFirstUpdate = false
@isFirstUpdateBackward = false


if time < @prevTime and time <= @props.startTime
@o.onReverseComplete?.apply(@)
@prevTime = time
Expand Down
3 changes: 2 additions & 1 deletion js/tween.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,15 @@ class Tween
@prevTime = time
# if completed
if time is @props.endTime
@o.onComplete?.apply(@); @onUpdate?(1); return true
@onUpdate?(1); @o.onComplete?.apply(@); return true

prepareStart:-> @getDimentions(); @o.onStart?.apply @
startTimelines:(time)->
i = @timelines.length
while(i--)
@timelines[i].start time or @props.startTime
start:(time)->

@setStartTime(time); !time and t.add @
@
stop:-> t.remove(@); @
Expand Down
24 changes: 12 additions & 12 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,18 @@ module.exports = function(config) {
exclude: [
'dist/mojs.js',
'dist/mojs.min.js',
'dist/h.js',
'spec/h.js',
'dist/transit.js',
'spec/transit.js',
'dist/swirl.js',
'spec/swirl.js',
'dist/tween.js',
'spec/tween.js',
'dist/burst.js',
'spec/burst.js',
'dist/tweener.js',
'spec/tweener.js'
// 'dist/h.js',
// 'spec/h.js',
// 'dist/transit.js',
// 'spec/transit.js',
// 'dist/swirl.js',
// 'spec/swirl.js',
// 'dist/tween.js',
// 'spec/tween.js',
// 'dist/burst.js',
// 'spec/burst.js',
// 'dist/tweener.js',
// 'spec/tweener.js'
],

// preprocess matching files before serving them to the browser
Expand Down

0 comments on commit 75c504e

Please sign in to comment.