diff options
author | Adam Coldrick <adam@sotk.co.uk> | 2015-09-26 18:20:06 +0100 |
---|---|---|
committer | Adam Coldrick <adam@sotk.co.uk> | 2015-09-28 20:24:57 +0100 |
commit | f83d048b53a9c2ec858ee44ddb8a781732dff72d (patch) | |
tree | 2acb9115086a593d5d382e36c163e092dd807c8e | |
parent | d4febb6aca849067d4347548e04ad245ab5a32c0 (diff) | |
download | ciat-ui-f83d048b53a9c2ec858ee44ddb8a781732dff72d.tar.gz |
Allow selection
-rw-r--r-- | index.html | 16 | ||||
-rw-r--r-- | js/main.js | 8 |
2 files changed, 17 insertions, 7 deletions
@@ -8,19 +8,21 @@ </head> <body ng-app="ciat"> <h1><em>Baserock</em> <span>|</span> CIAT</h1> - - <div class="visualisation" ng-controller="VisualisationController"> + <div class="container" ng-controller="VisualisationController" ng-click="select()" style="height: 100%"> + <div class="visualisation"> <div class="box" - ng-class="{'pass': step.lastBuild.success, 'active': step.data.state == 'building', 'fail': !step.lastBuild.success}" - ng-repeat="step in steps"> + ng-class="{'pass': step.lastBuild.success, 'active': step.data.state == 'building', 'fail': step.lastBuild.failed}" + ng-repeat="step in steps" + ng-click="select(step, $event)"> {{step.name}} </div> - <div class="details" + <div class="detail" ng-show="selected"> - <h3>{{step.name}}</h3> - <em>State:</em> {{step.data.state}} + <h3>{{selected.name}}</h3> + <em>State:</em> {{selected.data.state}} </div> </div> + </div> </body> </html> @@ -48,6 +48,14 @@ app.controller('VisualisationController', function($scope, $http, $q, $interval) }); } + $scope.selected = null; + $scope.select = function(step, e) { + if (e) { + e.stopPropagation(); + } + $scope.selected = step; + }; + function cancelRefresh() { if (angular.isDefined(autorefresh)) { $interval.cancel(autorefresh); |