Commit d8f2d412 by Rashid Khan

Fixed issue where panels would register twice. This breaks nice adding of new…

Fixed issue where panels would register twice. This breaks nice adding of new panels, working on it now
parent a76ceba3
...@@ -96,6 +96,10 @@ angular.module('kibana.controllers', []) ...@@ -96,6 +96,10 @@ angular.module('kibana.controllers', [])
} }
} }
$scope.send_render = function() {
$scope.$broadcast('render');
}
$scope.add_panel = function(row,panel) { $scope.add_panel = function(row,panel) {
console.log(panel) console.log(panel)
$scope.row.panels.push(panel); $scope.row.panels.push(panel);
......
...@@ -21,6 +21,7 @@ angular.module('kibana.services', []) ...@@ -21,6 +21,7 @@ angular.module('kibana.services', [])
// addressed to the scope in question and runs the registered function if it // addressed to the scope in question and runs the registered function if it
// is. // is.
this.register = function(scope,type,fn) { this.register = function(scope,type,fn) {
console.log('registered:' + type + " for " + scope.panel.title + " " + scope.$id)
scope.$on(type,function(event,packet){ scope.$on(type,function(event,packet){
var _id = scope.$id; var _id = scope.$id;
var _to = packet.to; var _to = packet.to;
......
<div class="row-fluid" ng-controller="histogram"> <div class="row-fluid">
<div class="span3"> <div class="span3">
<form style="margin-bottom: 0px"> <form style="margin-bottom: 0px">
<h6>Label</h6> <h6>Label</h6>
......
<kibana-panel ng-controller='histogram' style="height:{{row.height}}"> <kibana-panel ng-controller='histogram' style="height:{{row.height}}">
<div histogram params="{{panel}}" style="height:{{row.height}}"></div> <div>
<div histogram params="{{panel}} clearfix" style="height:{{row.height}}"></div>
</div>
</kibana-panel> </kibana-panel>
\ No newline at end of file
<div class="row-fluid" ng-controller="map"> <div class="row-fluid">
<div class="span6"> <div class="span6">
<form class="input-append"> <form class="input-append">
<h6>Query</h6> <h6>Query</h6>
......
<div class="row-fluid" ng-switch="panel.mode" ng-controller="pie"> <div class="row-fluid" ng-switch="panel.mode">
<div ng-switch-when="terms"> <div ng-switch-when="terms">
<div class="row-fluid"> <div class="row-fluid">
<div class="span4"> <div class="span4">
......
<div class="row-fluid" ng-controller="table"> <div class="row-fluid">
<div class="span12"> <div class="span12">
<form class="input-append"> <form class="input-append">
<h5>Query</h5> <h5>Query</h5>
......
<div ng-controller="text"> <div>
<label class="small">Font Size</label> <select class="input-mini" ng-model="panel.style['font-size']" ng-options="f for f in ['6pt','7pt','8pt','10pt','12pt','14pt','16pt','18pt','20pt','24pt','28pt','32pt','36pt','42pt','48pt','52pt','60pt','72pt']"></select> <label class="small">Font Size</label> <select class="input-mini" ng-model="panel.style['font-size']" ng-options="f for f in ['6pt','7pt','8pt','10pt','12pt','14pt','16pt','18pt','20pt','24pt','28pt','32pt','36pt','42pt','48pt','52pt','60pt','72pt']"></select>
<label class=small>Content</label> <label class=small>Content</label>
<textarea ng-model="panel.content" rows="6" style="width:95%"></textarea> <textarea ng-model="panel.content" rows="6" style="width:95%"></textarea>
......
<div class="row-fluid" ng-controller="timepicker"> <div class="row-fluid">
<div class="span3"> <div class="span3">
<h6>Default Mode</h6> <h6>Default Mode</h6>
<select style="width:85%" ng-model="panel.mode" ng-options="f for f in ['relative','absolute','since']"></select> <select style="width:85%" ng-model="panel.mode" ng-options="f for f in ['relative','absolute','since']"></select>
......
...@@ -13,5 +13,5 @@ ...@@ -13,5 +13,5 @@
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-success" ng-click="dismiss()">Close</button> <button type="button" class="btn btn-success" ng-click="dismiss();$broadcast('render')">Close</button>
</div> </div>
\ No newline at end of file
...@@ -45,5 +45,5 @@ ...@@ -45,5 +45,5 @@
</div> </div>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-success" ng-click="dismiss();reset_panel();">Close</button> <button type="button" class="btn btn-success" ng-click="dismiss();reset_panel();send_render()">Close</button>
</div> </div>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment