Skip to content

Commit

Permalink
Fix top services modal bug
Browse files Browse the repository at this point in the history
Service name wasn't cleared correctly
  • Loading branch information
cript0nauta committed Jul 6, 2017
1 parent 5ce2e76 commit d3f0cfb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/www/scripts/d3/directives/bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ angular.module('faradayApp')
var colored = document.createElement('div');
colored.style = "background-color:" + d.color; // Color is safe (its value is in a whitelist)
colored.innerText = name;
while (element.firstChild) {
// https://stackoverflow.com/questions/3955229/remove-all-child-elements-of-a-dom-node-in-javascript
element.removeChild(element.firstChild);
}
element.appendChild(colored);
element.appendChild(document.createTextNode(d.value));
})
Expand Down
4 changes: 4 additions & 0 deletions server/www/scripts/d3/directives/cake.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ angular.module('faradayApp')
var colored = document.createElement('div');
colored.style = "background-color:" + d.color; // Color is safe (its value is in a whitelist)
colored.innerText = d.key;
while (element.firstChild) {
// https://stackoverflow.com/questions/3955229/remove-all-child-elements-of-a-dom-node-in-javascript
element.removeChild(element.firstChild);
}
element.appendChild(colored);
element.appendChild(document.createTextNode(d.value));
})
Expand Down
4 changes: 4 additions & 0 deletions server/www/scripts/d3/directives/treemap.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ angular.module('faradayApp')
var colored = document.createElement('div');
colored.style = "background-color:" + d.color; // Color is safe (its value is in a whitelist)
colored.innerText = d.name;
while (element.firstChild) {
// https://stackoverflow.com/questions/3955229/remove-all-child-elements-of-a-dom-node-in-javascript
element.removeChild(element.firstChild);
}
element.appendChild(colored);
element.appendChild(document.createTextNode(d.count));
})
Expand Down

0 comments on commit d3f0cfb

Please sign in to comment.