Sfoglia il codice sorgente

Fixed rerender on panel save, only applied to time picker now, removed debug statement from hits panel

Rashid Khan 12 anni fa
parent
commit
7373e37490
4 ha cambiato i file con 9 aggiunte e 6 eliminazioni
  1. 3 2
      js/controllers.js
  2. 0 2
      panels/hits/module.js
  3. 4 0
      panels/timepicker/module.js
  4. 2 2
      partials/paneleditor.html

+ 3 - 2
js/controllers.js

@@ -109,8 +109,9 @@ angular.module('kibana.controllers', [])
     }
   }
 
-  $scope.send_render = function() {
-    $scope.$broadcast('render');
+  $scope.close_modal = function() {
+    // Dummy function, available for overriding in child scopes. For example
+    // a panel might want to broadcast an event when a modal is closed
   }
 
   $scope.add_panel = function(row,panel) {

+ 0 - 2
panels/hits/module.js

@@ -146,8 +146,6 @@ angular.module('kibana.hits', [])
                     
         // Populate element. Note that jvectormap appends, does not replace.
         scripts.wait(function(){
-          console.log(scope.data)
-
           // Populate element
           try { 
             var plot = $.plot(elem, scope.data, {

+ 4 - 0
panels/timepicker/module.js

@@ -167,6 +167,10 @@ angular.module('kibana.timepicker', [])
     $scope.time_apply();
   }
 
+  $scope.close_modal = function() {
+    $scope.$broadcast('render');
+  }
+
   $scope.time_check = function(){
 
     // If time picker is defined (on initialization)

+ 2 - 2
partials/paneleditor.html

@@ -1,6 +1,6 @@
 <div class="modal-header">
   <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
-  <h3>{{panel.title}} <small>editor</small></h3>
+  <h3>{{panel.title}} Editor</h3>
 </div>
 <div class="modal-body">
 
@@ -13,5 +13,5 @@
   
 </div>
 <div class="modal-footer">
-  <button type="button" class="btn btn-success" ng-click="dismiss();send_render()">Close</button>
+  <button type="button" class="btn btn-success" ng-click="dismiss();close_modal()">Close</button>
 </div>