mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
Backport PR #8571
---------
**Commit 1:**
Save settings on enter keypress
Remove unused imports
* Original sha: 09d334694d
* Authored by Thomas Neirynck <thomas@elastic.co> on 2016-10-06T15:46:48Z
This commit is contained in:
parent
583ff7db01
commit
373cbff588
4 changed files with 12 additions and 5 deletions
|
@ -3,7 +3,6 @@ import { useResizeCheckerProvider } from '../sense_editor_resize';
|
|||
import $ from 'jquery';
|
||||
import { initializeInput } from '../input';
|
||||
import { initializeOutput } from '../output';
|
||||
import es from '../es';
|
||||
import init from '../app';
|
||||
import { SenseTopNavController } from './sense_top_nav_controller';
|
||||
|
||||
|
@ -20,7 +19,7 @@ module.run(function (Private, $rootScope) {
|
|||
module.controller('SenseController', function SenseController(Private, $scope, $timeout, $location, docTitle) {
|
||||
docTitle.change('Console');
|
||||
|
||||
$scope.topNavController = Private(SenseTopNavController)
|
||||
$scope.topNavController = Private(SenseTopNavController);
|
||||
|
||||
// We need to wait for these elements to be rendered before we can select them with jQuery
|
||||
// and then initialize this app
|
||||
|
|
|
@ -7,7 +7,7 @@ require('ui/modules')
|
|||
restrict: 'E',
|
||||
template: require('./settings.html'),
|
||||
controllerAs: 'settings',
|
||||
controller: function ($scope) {
|
||||
controller: function ($scope, $element) {
|
||||
const settings = require('../settings');
|
||||
|
||||
this.vals = settings.getCurrentSettings();
|
||||
|
@ -16,6 +16,16 @@ require('ui/modules')
|
|||
$scope.kbnTopNav.close();
|
||||
};
|
||||
|
||||
const self = this;
|
||||
|
||||
function onEnter(event) {
|
||||
if (event.which === 13) {
|
||||
self.apply();
|
||||
}
|
||||
}
|
||||
|
||||
const boundElement = $element.bind('keydown', onEnter);
|
||||
$scope.$on('$destroy', () => boundElement.unbind('keydown', onEnter));
|
||||
},
|
||||
};
|
||||
});
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import _ from 'lodash';
|
||||
import 'ui/watch_multi';
|
||||
import angular from 'angular';
|
||||
import 'ui/directives/input_focus';
|
||||
import uiModules from 'ui/modules';
|
||||
import template from './kbn_top_nav.html';
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import { capitalize, isArray, isFunction } from 'lodash';
|
||||
|
||||
import chrome from 'ui/chrome';
|
||||
import uiModules from 'ui/modules';
|
||||
import filterTemplate from 'ui/chrome/config/filter.html';
|
||||
import intervalTemplate from 'ui/chrome/config/interval.html';
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue