Commit cd2161e7 by Torkel Ödegaard

Revert "Fix typeahead to avoid generating new backend request on each keypress. (#10596)"

This reverts commit 475febd0.
parent c34d458b
...@@ -123,11 +123,11 @@ export function queryPartEditorDirective($compile, templateSrv) { ...@@ -123,11 +123,11 @@ export function queryPartEditorDirective($compile, templateSrv) {
}); });
var typeahead = $input.data('typeahead'); var typeahead = $input.data('typeahead');
typeahead.lookup = _.debounce(function() { typeahead.lookup = function() {
this.query = this.$element.val() || ''; this.query = this.$element.val() || '';
var items = this.source(this.query, $.proxy(this.process, this)); var items = this.source(this.query, $.proxy(this.process, this));
return items ? this.process(items) : items; return items ? this.process(items) : items;
}, 500); };
} }
$scope.showActionsMenu = function() { $scope.showActionsMenu = function() {
......
...@@ -129,11 +129,11 @@ function (_, $, coreModule) { ...@@ -129,11 +129,11 @@ function (_, $, coreModule) {
$input.typeahead({ source: $scope.source, minLength: 0, items: 10000, updater: $scope.updater, matcher: $scope.matcher }); $input.typeahead({ source: $scope.source, minLength: 0, items: 10000, updater: $scope.updater, matcher: $scope.matcher });
var typeahead = $input.data('typeahead'); var typeahead = $input.data('typeahead');
typeahead.lookup = _.debounce(function() { typeahead.lookup = function () {
this.query = this.$element.val() || ''; this.query = this.$element.val() || '';
var items = this.source(this.query, $.proxy(this.process, this)); var items = this.source(this.query, $.proxy(this.process, this));
return items ? this.process(items) : items; return items ? this.process(items) : items;
}, 500); };
$button.keydown(function(evt) { $button.keydown(function(evt) {
// trigger typeahead on down arrow or enter key // trigger typeahead on down arrow or enter key
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment