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

Initial work on #9 (millisecond y axis formater)

Torkel Ödegaard 12 лет назад
Родитель
Сommit
d259f14267
2 измененных файлов с 10 добавлено и 2 удалено
  1. 9 0
      src/app/components/kbn.js
  2. 1 2
      src/app/directives/kibanaPanel.js

+ 9 - 0
src/app/components/kbn.js

@@ -505,5 +505,14 @@ function($, _, moment) {
     return (size.toFixed(decimals) + ext);
   };
 
+  kbn.msFormat = function(size) {
+    if (size < 500) {
+      return size.toFixed(0) + " ms";
+    }
+    else {
+      return (size / 1000).toFixed(0) + " s";
+    }
+  };
+
   return kbn;
 });

+ 1 - 2
src/app/directives/kibanaPanel.js

@@ -61,8 +61,7 @@ function (angular, $) {
 
           $scope.kbnJqUiDraggableOptions = {
             revert: 'invalid',
-            helper: function(event) {
-              console.log(event);
+            helper: function() {
               return $('<div style="width:200px;height:100px;background: rgba(100,100,100,0.50);"/>');
             },
             placeholder: 'keep'