Skip to content

Commit

Permalink
refactor: build list item bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
Ephigenia committed Jan 5, 2017
1 parent f0a849e commit 1e139bb
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
1 change: 0 additions & 1 deletion source/scripts/BuildList.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
},
templateUrl: 'scripts/BuildList.html',
controller: function() {

}
});
})();
18 changes: 9 additions & 9 deletions source/scripts/BuildListItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
controller: function($filter, $element) {
var ctrl = this;

// @TODO when failed colorize the whole row

switch (ctrl.build.outcome) {
default:
break;
case 'failed':
$element.addClass('table-danger');
break;
}
this.$onInit = function() {
switch (this.build.outcome) {
default:
break;
case 'failed':
$element.addClass('table-danger');
break;
}
};

Object.defineProperties(this, {
committerTitle: {
Expand Down
12 changes: 7 additions & 5 deletions source/scripts/MainComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@
BuildService.stopPolling();
};

if (this.apiToken) {
$log.info('apiToken found, start polling');
BuildService.apiToken = this.apiToken;
BuildService.startPolling(this.refreshInterval);
}
this.$onInit = function() {
if (this.apiToken) {
$log.info('apiToken found, start polling');
BuildService.apiToken = this.apiToken;
BuildService.startPolling(this.refreshInterval);
}
};
}
});
})();

0 comments on commit 1e139bb

Please sign in to comment.