]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-2074 Use Prototype #getWidth() method to access DIV width
authorFabrice Bellingard <bellingard@gmail.com>
Mon, 5 Sep 2011 16:31:17 +0000 (18:31 +0200)
committerFabrice Bellingard <bellingard@gmail.com>
Mon, 5 Sep 2011 16:31:17 +0000 (18:31 +0200)
sonar-server/src/main/webapp/javascripts/protovis-sonar.js

index bf6899af2dd85f134d2ec7459b9a1cd686e070f3..4f25c2d19204bf5fbb094c707b65841cd27f2fb1 100755 (executable)
@@ -42,13 +42,13 @@ SonarWidgets.Timeline.prototype.render = function() {
        var translations = this.wTranslations;
        var events = this.wEvents;
        
-       var widgetDiv = document.getElementById(this.wDivId);
+       var widgetDiv = $(this.wDivId);
        var footerFont = "10.5px Arial,Helvetica,sans-serif";
        var show_y_axis = (trendData.size()==1)
        
        /* Sizing and scales. */
        var headerHeight = 4 + Math.max(this.wMetrics.size(), events ? 2 : 1) * 18;
-       var w = widgetDiv.parentNode.offsetWidth - 60; 
+       var w = widgetDiv.getOffsetParent().getWidth() - 60; 
        var     h = (this.wHeight == null ? 80 : this.wHeight) + headerHeight;
        var yMaxHeight = h-headerHeight;