Skip to content

Commit

Permalink
~ 开始计时自动设置 count
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudcome committed Jul 6, 2017
1 parent 4b48ce3 commit 21d44a0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/index.js
Expand Up @@ -46,7 +46,6 @@ var CountDown = Events.extend({
options.count = options.count.getTime() - date.now();
}

the[_count] = options.count;
the.state = STATE_READY;
CountDown.parent(the);
},
Expand All @@ -63,6 +62,7 @@ var CountDown = Events.extend({
return the;
}

the[_count] = the[_options].count;
the.state = STATE_STARTED;
the.emit('start');
var timer = the[_timer] = time.setInterval(function () {
Expand Down Expand Up @@ -153,6 +153,7 @@ var CountDown = Events.extend({
return the;
}

the[_count] = 0;
time.clearInterval(the[_timer]);
the[_timer] = null;
the.state = STATE_READY;
Expand Down

0 comments on commit 21d44a0

Please sign in to comment.