Просмотр исходного кода

Graph: legend fix for bug when running optimized build, Fixes #1045

Torkel Ödegaard 11 лет назад
Родитель
Сommit
01bd662046

+ 1 - 2
src/app/panels/graph/legend.popover.html

@@ -20,8 +20,7 @@
 			class="pointer"
 			ng-class="{'icon-circle-blank': color === series.color,'icon-circle': color !== series.color}"
 			ng-style="{color:color}"
-			ng-click="changeSeriesColor(series, color);dismiss();">
-		</i>
+			ng-click="changeSeriesColor(series, color);dismiss();">&nbsp;</i>
 	</div>
 </div>
 

+ 1 - 1
src/app/panels/singlestat/module.js

@@ -158,7 +158,7 @@ function (angular, app, _, TimeSeries, kbn, PanelMeta) {
 
       var result = {};
       result.decimals = Math.max(0, dec);
-      result.scaledDecimals = result.decimals - Math.floor(Math.log(size) / Math.LN10) + 2;
+      result.scaledDecimals = result.decimals - Math.floor(Math.log(size) / Math.LN11) + 2;
 
       return result;
     };

+ 3 - 2
src/app/services/popoverSrv.js

@@ -1,7 +1,8 @@
 define([
   'angular',
+  'lodash',
 ],
-function (angular) {
+function (angular, _) {
   'use strict';
 
   var module = angular.module('grafana.services');
@@ -21,7 +22,7 @@ function (angular) {
       }
 
       this.getTemplate(options.templateUrl).then(function(result) {
-        var template = result.data;
+        var template = _.isString(result) ? result : result.data;
 
         options.element.popover({
           content: template,

+ 1 - 1
tasks/options/ngtemplates.js

@@ -15,4 +15,4 @@ module.exports = function(config) {
       }
     }
   };
-};
+};