aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server/src/main/js
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2014-05-23 17:47:41 +0200
committerStas Vilchik <vilchiks@gmail.com>2014-05-23 17:47:48 +0200
commite76b49e6a11cc9b5d18f88105e24e697e4443ceb (patch)
treee7aa83ebc3a202ca9dc1258a11ea484cf9a4fbb1 /sonar-server/src/main/js
parent477d87e75b3fe9a3d36f3cc2626907c8b477a351 (diff)
downloadsonarqube-e76b49e6a11cc9b5d18f88105e24e697e4443ceb.tar.gz
sonarqube-e76b49e6a11cc9b5d18f88105e24e697e4443ceb.zip
SONAR-5333 Add spinners for measure filters
Diffstat (limited to 'sonar-server/src/main/js')
-rw-r--r--sonar-server/src/main/js/widgets/widget.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/sonar-server/src/main/js/widgets/widget.js b/sonar-server/src/main/js/widgets/widget.js
index 4c7f3a6a06e..13e290a3af1 100644
--- a/sonar-server/src/main/js/widgets/widget.js
+++ b/sonar-server/src/main/js/widgets/widget.js
@@ -40,8 +40,10 @@ window.SonarWidgets = window.SonarWidgets == null ? {} : window.SonarWidgets;
window.SonarWidgets.Widget.prototype.render = function(container) {
var that = this;
+ this.showSpinner(container);
d3.json(this.source(), function(error, response) {
if (response && !error) {
+ that.hideSpinner();
if (response.components.length > 0) {
that.widget = new SonarWidgets[that.type()]();
that.widget
@@ -64,6 +66,18 @@ window.SonarWidgets = window.SonarWidgets == null ? {} : window.SonarWidgets;
};
+ window.SonarWidgets.Widget.prototype.showSpinner = function(container) {
+ this.spinner = d3.select(container).append('i').classed('spinner', true);
+ };
+
+
+ window.SonarWidgets.Widget.prototype.hideSpinner = function() {
+ if (this.spinner) {
+ this.spinner.remove();
+ }
+ };
+
+
window.SonarWidgets.Widget.prototype.update = function(container) {
return this.widget && this.widget.update(container);
};