Merge branch 'master' into popover-forms

This commit is contained in:
Torkel Ödegaard
2017-04-13 16:22:08 +02:00
113 changed files with 25110 additions and 4073 deletions

View File

@@ -40,7 +40,14 @@ export function infoPopover() {
openOn: openOn,
hoverOpenDelay: 400,
tetherOptions: {
offset: offset
offset: offset,
constraints: [
{
to: 'window',
attachment: 'together',
pin: true
}
],
}
});

View File

@@ -119,5 +119,3 @@ export function identityRenderer(part, innerExpr) {
export function quotedIdentityRenderer(part, innerExpr) {
return '"' + part.params[0] + '"';
}

View File

@@ -91,7 +91,13 @@ export function queryPartEditorDirective($compile, templateSrv) {
}
var typeaheadSource = function (query, callback) {
if (param.options) { return param.options; }
if (param.options) {
var options = param.options;
if (param.type === 'int') {
options = _.map(options, function(val) { return val.toString(); });
}
return options;
}
$scope.$apply(function() {
$scope.handleEvent({$event: {name: 'get-param-options'}}).then(function(result) {
@@ -102,10 +108,6 @@ export function queryPartEditorDirective($compile, templateSrv) {
};
$input.attr('data-provide', 'typeahead');
var options = param.options;
if (param.type === 'int') {
options = _.map(options, function(val) { return val.toString(); });
}
$input.typeahead({
source: typeaheadSource,

View File

@@ -101,18 +101,16 @@ function (angular, _, coreModule, config) {
}
metricSources.sort(function(a, b) {
if (a.meta.builtIn) {
// these two should always be at the bottom
if (a.meta.id === "mixed" || a.meta.id === "grafana") {
return 1;
}
if (b.meta.builtIn) {
if (b.meta.id === "mixed" || b.meta.id === "grafana") {
return -1;
}
if (a.name.toLowerCase() > b.name.toLowerCase()) {
return 1;
}
if (a.name.toLowerCase() < b.name.toLowerCase()) {
return -1;
}