Refactored panel communication to use an angular service, started work on panel editing interface

This commit is contained in:
Rashid Khan
2013-02-07 15:05:55 -07:00
parent 085b688850
commit ee65f81a2b
18 changed files with 178 additions and 75 deletions
+4 -5
View File
@@ -1,5 +1,5 @@
angular.module('kibana.map', [])
.controller('map', function($scope, $rootScope) {
.controller('map', function($scope, eventBus) {
var _id = _.uniqueId();
@@ -15,14 +15,13 @@ angular.module('kibana.map', [])
_.defaults($scope.panel,_d)
$scope.init = function() {
$scope.$on(_id+"-time", function(event,time){set_time(time)});
$scope.$on($scope.panel.group+"-time", function(event,time){set_time(time)});
$scope.$on($scope.panel.group+"-query", function(event, query) {
eventBus.register($scope,'time', function(event,time){set_time(time)});
eventBus.register($scope,'query', function(event, query) {
$scope.panel.query = query;
$scope.get_data();
});
// Now that we're all setup, request the time from our group
$rootScope.$broadcast($scope.panel.group+"-get_time",_id)
eventBus.broadcast($scope.$id,$scope.panel.group,'get_time')
}
$scope.get_data = function() {