kibana-123
Version:
Kibana is an open source (Apache Licensed), browser based analytics and search dashboard for Elasticsearch. Kibana is a snap to setup and start using. Kibana strives to be easy to get started with, while also being flexible and powerful, just like Elastic
23 lines (20 loc) • 561 B
JavaScript
import _ from 'lodash';
import $ from 'jquery';
import uiModules from 'ui/modules';
let module = uiModules.get('kibana');
module.directive('clickFocus', function () {
return {
scope: {
clickFocus: '='
},
restrict: 'A',
link: function ($scope, $elem) {
function handler() {
let focusElem = $.find('input[name=' + $scope.clickFocus + ']');
if (focusElem[0]) focusElem[0].focus();
}
$elem.bind('click', handler);
$scope.$on('$destroy', _.bindKey($elem, 'unbind', 'click', handler));
}
};
});