mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Added better match when using graphite function autocomplete, hit tab key and the first match will be used, you no longer need to use the down arrow to select the typeahead match you want, just hit tab key
This commit is contained in:
parent
afdc19ce9d
commit
d2421bb216
@ -38,6 +38,14 @@ function (angular, app, _, $, gfunc) {
|
||||
items: 10,
|
||||
updater: function (value) {
|
||||
var funcDef = gfunc.getFuncDef(value);
|
||||
if (!funcDef) {
|
||||
// try find close match
|
||||
funcDef = _.find(allFunctions, function(funcName) {
|
||||
return funcName.toLowerCase().indexOf(value) === 0;
|
||||
});
|
||||
|
||||
if (!funcDef) { return; }
|
||||
}
|
||||
|
||||
$scope.$apply(function() {
|
||||
$scope.addFunction(funcDef);
|
||||
|
Loading…
Reference in New Issue
Block a user