diff --git a/js/controllers.js b/js/controllers.js index 2ea1be3aa1c..c6195b273fa 100644 --- a/js/controllers.js +++ b/js/controllers.js @@ -23,7 +23,6 @@ angular.module('kibana.controllers', []) $scope.config = config; // Make underscore.js available to views $scope._ = _; - $scope.dashboard = dashboard; // Provide a global list of all see fields @@ -89,7 +88,7 @@ angular.module('kibana.controllers', []) $scope.init(); }) -.controller('RowCtrl', function($scope, $rootScope, $timeout, ejsResource) { +.controller('RowCtrl', function($scope, $rootScope, $timeout, ejsResource, querySrv) { var _d = { title: "Row", @@ -104,6 +103,7 @@ angular.module('kibana.controllers', []) $scope.init = function() { + $scope.querySrv = querySrv; $scope.reset_panel(); }; diff --git a/js/services.js b/js/services.js index f6cd7495092..7cf83ccfbd4 100644 --- a/js/services.js +++ b/js/services.js @@ -289,6 +289,20 @@ angular.module('kibana.services', []) return _.findWhere(self.list,{query:queryString}); }; + this.idsByMode = function(config) { + switch(config.mode) + { + case 'all': + return self.ids; + case 'pinned': + return _.pluck(_.where(self.list,{pin:true}),'id'); + case 'selected': + return _.intersection(self.ids,config.ids); + default: + return self.ids; + } + }; + var nextId = function() { if(_q.idQueue.length > 0) { return _q.idQueue.shift(); diff --git a/js/shared.js b/js/shared.js index fe7c553fc33..91e457bb982 100644 --- a/js/shared.js +++ b/js/shared.js @@ -343,3 +343,15 @@ _.mixin({ return array; } }); + +_.mixin({ + toggleInOut: function(array,value) { + 'use strict'; + if(_.contains(array,value)) { + array = _.without(array,value); + } else { + array.push(value); + } + return array; + } +}); diff --git a/panels/bettermap/editor.html b/panels/bettermap/editor.html index d2ebb3e7ac5..963801de903 100644 --- a/panels/bettermap/editor.html +++ b/panels/bettermap/editor.html @@ -22,6 +22,7 @@ +
