]> source.dussan.org Git - sonarqube.git/commitdiff
Fix treemaps on IE8
authorSimon Brandhof <simon.brandhof@gmail.com>
Wed, 5 Dec 2012 16:28:37 +0000 (17:28 +0100)
committerSimon Brandhof <simon.brandhof@gmail.com>
Wed, 5 Dec 2012 16:29:03 +0000 (17:29 +0100)
plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/MeasureFilterTreemapWidget.java
sonar-server/src/main/webapp/WEB-INF/app/helpers/measures_helper.rb
sonar-server/src/main/webapp/javascripts/application.js
sonar-server/src/main/webapp/stylesheets/layout.css

index e6e4af46bff7814ecce5ec85f7b8c019ba05c423..ff41d441dcabea6bd0f028086845360c3123247d 100644 (file)
@@ -34,7 +34,7 @@ import static org.sonar.api.web.WidgetScope.GLOBAL;
 @WidgetProperties({
   @WidgetProperty(key = MeasureFilterTreemapWidget.FILTER_PROPERTY, type = WidgetPropertyType.FILTER, optional = false),
   @WidgetProperty(key = MeasureFilterTreemapWidget.SIZE_METRIC_PROPERTY, type = WidgetPropertyType.METRIC, optional = true),
-  @WidgetProperty(key = MeasureFilterTreemapWidget.COLOR_METRIC_PROPERTY, type = WidgetPropertyType.METRIC, optional = true)
+  @WidgetProperty(key = MeasureFilterTreemapWidget.COLOR_METRIC_PROPERTY, type = WidgetPropertyType.METRIC, optional = true, options = "type:PERCENT")
 }
 )
 public class MeasureFilterTreemapWidget extends AbstractRubyTemplate implements RubyRailsWidget {
index 5c8ceb97160ef6fdda1b179724b60a5ad5e8dabb..accc20e7455db3a32117bdc1ec12d90548605f70 100644 (file)
@@ -39,8 +39,10 @@ module MeasuresHelper
       measure = result.measure(column.metric)
       if column.period
         format_variation(measure, :index => column.period, :style => 'light')
-      else
+      elsif column.metric.numeric?
         format_measure(measure) + trend_icon(measure, :empty => true)
+      else
+        format_measure(measure)
       end
 
     elsif column.key=='name'
index ccb3314dd39904ca5a9f3333acc5e7a82377d1a9..8cf2fb241674ff5461110b8ddd2fde5b18fe922b 100644 (file)
@@ -163,20 +163,10 @@ var Treemap = function (id, sizeMetric, colorMetric) {
   this.colorMetric = colorMetric;
   this.breadcrumb = [];
   treemaps[id] = this;
-  this.rootNode().height(this.rootNode().width() * 0.6);
+  this.rootNode().height(this.rootNode().width() * 0.55);
   this.initNodes();
 
 };
-Treemap.prototype.changeSizeMetric = function (metric) {
-  this.sizeMetric = metric;
-  this.load();
-  return false;
-};
-Treemap.prototype.changeColorMetric = function (metric) {
-  this.colorMetric = metric;
-  this.load();
-  return false;
-};
 Treemap.prototype.currentContext = function () {
   if (this.breadcrumb.length > 0) {
     return this.breadcrumb[this.breadcrumb.length - 1];
@@ -215,31 +205,33 @@ Treemap.prototype.initNodes = function () {
     });
   });
   $j('#tm-' + this.id).find('[rid]').each(function (index) {
-      this.on("contextmenu", function (event) {
-        event.preventDefault();
-        // right click
-        if (self.breadcrumb.length > 1) {
-          self.breadcrumb.pop();
+    this.on("contextmenu", function (event) {
+      event.stopPropagation();
+      event.preventDefault();
+      // right click
+      if (self.breadcrumb.length > 1) {
+        self.breadcrumb.pop();
+        self.load();
+      } else {
+        $j("#tm-loading-" + self.id).show();
+        location.reload();
+      }
+      return false;
+    });
+
+    this.on("click", function (event) {
+        var source = $j(this);
+        var rid = source.attr('rid');
+        var has_leaves = !!(source.attr('l'));
+        if (!has_leaves) {
+          var context = new TreemapContext(rid, source.text());
+          self.breadcrumb.push(context);
           self.load();
-        } else {
-          location.reload();
         }
-        return false;
-      });
-      this.on("click", function (event) {
-          var source = $j(this);
-          var rid = source.attr('rid');
-          var has_leaves = !!(source.attr('l'));
-          if (!has_leaves) {
-            var context = new TreemapContext(rid, source.text());
-            self.breadcrumb.push(context);
-            self.load();
-          }
-        }
-      );
 
-    }
-  );
+      }
+    )
+  });
 };
 
 (function ($j) {
index ad42bfad1b0cc49c1f756e909796c1ea04329652..e65d973ceeed5bb63cbe6ecfab1514c982370b48 100644 (file)
@@ -275,7 +275,6 @@ ul.sidebar select, ul.sidebar input {
 }
 
 .page-split-right {
-  position: relative;
   display: block;
   margin: 0;
   vertical-align: top;