Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions addon/components/x-timer.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,19 @@ export default Ember.Component.extend({
//TODO: check the usage of this variable
isRunning: false,

didInsertElement: function(){
if(this.get("autoStart")){
_init: function _init() {
if (this.get("autoStart")) {
this.send("start");
}
},

didInsertElement: function(){
this._init();
},

didUpdateAttrs: function didUpdateAttrs() {
this._init();
},

showStartBtn: function(){
return this.get("isStopWatch") || !this.get("autoStart");
Expand Down
2 changes: 1 addition & 1 deletion app/templates/components/x-timer.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h4>{{duration}}</h4>
{{duration}}
{{#if showStartBtn}}
<button type="submit" class="btn btn-sm btn-default" {{action "start"}}>Start</button>
{{/if}}
Expand Down