Skip to content

Commit

Permalink
Fixed condition to render the graph even when there is change in runn…
Browse files Browse the repository at this point in the history
…ing status
  • Loading branch information
pskumar448 committed Jan 23, 2017
1 parent f52b389 commit 22681df
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/webapp/scripts/buildgraph-appctrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ angular.module('buildgraphapp', [])
var buildGraphDataModel = {nodes:[],connectors:[]};
var buildGraphPlumb = jsPlumb.getInstance({Container:"buildgraph"});
var nodesSize = 0;
var isBuilding = false;
$scope.callAtTimeout = function() {
$http.get(ajaxPath)
.then(function(response) {
var data = JSON.parse(response.data);
var buildGraph = JSON.parse(data.buildGraph);
if(buildGraph.isBuilding || nodesSize != buildGraph.nodesSize) {
if(buildGraph.isBuilding || nodesSize != buildGraph.nodesSize || isBuilding != buildGraph.isBuilding) {
nodesSize = buildGraph.nodesSize;
isBuilding = buildGraph.isBuilding;
$scope.buildGraphViewModel = buildGraph;
$timeout(function() {
buildGraphPlumb.reset();
Expand Down

0 comments on commit 22681df

Please sign in to comment.