module.js 886 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. ## filtering
  3. An experimental for interacting with the filter service
  4. ### Parameters
  5. */
  6. angular.module('kibana.filtering', [])
  7. .controller('filtering', function($scope, filterSrv, $rootScope, dashboard) {
  8. // Set and populate defaults
  9. var _d = {
  10. status : "Experimental"
  11. }
  12. _.defaults($scope.panel,_d);
  13. $scope.init = function() {
  14. $scope.filterSrv = filterSrv
  15. }
  16. $scope.remove = function(id) {
  17. filterSrv.remove(id);
  18. dashboard.refresh();
  19. }
  20. $scope.toggle = function(id) {
  21. filterSrv.list[id].active = !filterSrv.list[id].active;
  22. dashboard.refresh();
  23. }
  24. $scope.refresh = function(query) {
  25. $rootScope.$broadcast('refresh')
  26. }
  27. $scope.render = function(query) {
  28. $rootScope.$broadcast('render')
  29. }
  30. $scope.show_key = function(key) {
  31. return !_.contains(['type','id','alias','mandate','active','editing'],key)
  32. }
  33. });