diff --git a/js/directives.js b/js/directives.js index 720403ca62c..c5c09f0ad39 100644 --- a/js/directives.js +++ b/js/directives.js @@ -66,5 +66,21 @@ angular.module('kibana.directives', []) } } } +}).directive('ngModelOnblur', function() { + return { + restrict: 'A', + require: 'ngModel', + link: function(scope, elm, attr, ngModelCtrl) { + if (attr.type === 'radio' || attr.type === 'checkbox') return; + + elm.unbind('input').unbind('keydown').unbind('change'); + elm.bind('blur', function() { + scope.$apply(function() { + ngModelCtrl.$setViewValue(elm.val()); + }); + }); + } + }; }); +; diff --git a/panels/dashcontrol/module.js b/panels/dashcontrol/module.js index 3f604298972..4edbd8b882e 100644 --- a/panels/dashcontrol/module.js +++ b/panels/dashcontrol/module.js @@ -1,8 +1,6 @@ angular.module('kibana.dashcontrol', []) .controller('dashcontrol', function($scope, $http, eventBus, timer) { - var _id = _.uniqueId(); - // Set and populate defaults var _d = { group : "default", diff --git a/panels/fields/module.js b/panels/fields/module.js index 534ef8e5cd4..334f964eee6 100644 --- a/panels/fields/module.js +++ b/panels/fields/module.js @@ -1,8 +1,6 @@ angular.module('kibana.fields', []) .controller('fields', function($scope, eventBus, $timeout) { - var _id = _.uniqueId(); - // Set and populate defaults var _d = { group : "default", diff --git a/panels/histogram/module.js b/panels/histogram/module.js index 5d5b163959a..6fe930ce034 100644 --- a/panels/histogram/module.js +++ b/panels/histogram/module.js @@ -1,8 +1,6 @@ angular.module('kibana.histogram', []) .controller('histogram', function($scope, eventBus) { - var _id = _.uniqueId(); - // Set and populate defaults var _d = { query : [ {query: "*", label:"Query"} ], @@ -17,7 +15,13 @@ angular.module('kibana.histogram', []) $scope.init = function() { eventBus.register($scope,'time', function(event,time){set_time(time)}); eventBus.register($scope,'query', function(event, query) { - $scope.panel.query[0].query = query; + if(_.isArray(query)) { + $scope.panel.query = _.map(query,function(q) { + return {query: q, label: q}; + }) + } else { + $scope.panel.query[0] = {query: query, label: query} + } $scope.get_data(); }); // Now that we're all setup, request the time from our group if we don't diff --git a/panels/hits/editor.html b/panels/hits/editor.html index 3d1852ed454..437e7a16dd4 100644 --- a/panels/hits/editor.html +++ b/panels/hits/editor.html @@ -1,3 +1,9 @@ +