Fixed interpanel communication

This commit is contained in:
Rashid Khan
2013-02-05 14:30:08 -07:00
parent 834e63a123
commit 1095373aa7
12 changed files with 278 additions and 212 deletions
+7 -6
View File
@@ -1,21 +1,22 @@
angular.module('kibana.stringquery', [])
.controller('stringquery', function($scope, $rootScope) {
var _id = _.uniqueId();
// Set and populate defaults
var _d = {
label : "Search",
query : "*",
size : 100,
sort : [config.timefield,'desc'],
group : "default"
}
_.each(_d, function(v, k) {
$scope.panel[k] = _.isUndefined($scope.panel[k])
? _d[k] : $scope.panel[k];
});
_.defaults($scope.panel,_d);
if (!(_.isUndefined($scope.panel.group))) {
$scope.init = function() {
$scope.send_query = function(query) {
$rootScope.$broadcast($scope.panel.group+"-query", query)
}
}
})
$scope.init();
});