Fixed issue where panels would register twice. This breaks nice adding of new panels, working on it now

This commit is contained in:
Rashid Khan 2013-02-14 08:37:03 -07:00
parent a76ceba30f
commit d8f2d412cd
11 changed files with 16 additions and 9 deletions

View File

@ -96,6 +96,10 @@ angular.module('kibana.controllers', [])
}
}
$scope.send_render = function() {
$scope.$broadcast('render');
}
$scope.add_panel = function(row,panel) {
console.log(panel)
$scope.row.panels.push(panel);

View File

@ -21,6 +21,7 @@ angular.module('kibana.services', [])
// addressed to the scope in question and runs the registered function if it
// is.
this.register = function(scope,type,fn) {
console.log('registered:' + type + " for " + scope.panel.title + " " + scope.$id)
scope.$on(type,function(event,packet){
var _id = scope.$id;
var _to = packet.to;

View File

@ -1,4 +1,4 @@
<div class="row-fluid" ng-controller="histogram">
<div class="row-fluid">
<div class="span3">
<form style="margin-bottom: 0px">
<h6>Label</h6>

View File

@ -1,3 +1,5 @@
<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>

View File

@ -1,4 +1,4 @@
<div class="row-fluid" ng-controller="map">
<div class="row-fluid">
<div class="span6">
<form class="input-append">
<h6>Query</h6>

View File

@ -1,4 +1,4 @@
<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 class="row-fluid">
<div class="span4">

View File

@ -1,4 +1,4 @@
<div class="row-fluid" ng-controller="table">
<div class="row-fluid">
<div class="span12">
<form class="input-append">
<h5>Query</h5>

View File

@ -1,4 +1,4 @@
<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>Content</label>
<textarea ng-model="panel.content" rows="6" style="width:95%"></textarea>

View File

@ -1,4 +1,4 @@
<div class="row-fluid" ng-controller="timepicker">
<div class="row-fluid">
<div class="span3">
<h6>Default Mode</h6>
<select style="width:85%" ng-model="panel.mode" ng-options="f for f in ['relative','absolute','since']"></select>

View File

@ -13,5 +13,5 @@
</div>
<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>

View File

@ -45,5 +45,5 @@
</div>
</div>
<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>