Commit ccc97ed6 by Leonard Gram Committed by GitHub

Merge pull request #15634 from grafana/15621-series-overrides

graph: fixes click after scroll in series override menu
parents 5ff44bdb e76655df
...@@ -128,7 +128,7 @@ export function dropdownTypeahead2($compile) { ...@@ -128,7 +128,7 @@ export function dropdownTypeahead2($compile) {
'<input type="text"' + ' class="gf-form-input"' + ' spellcheck="false" style="display:none"></input>'; '<input type="text"' + ' class="gf-form-input"' + ' spellcheck="false" style="display:none"></input>';
const buttonTemplate = const buttonTemplate =
'<a class="gf-form-input dropdown-toggle"' + '<a class="{{buttonTemplateClass}} dropdown-toggle"' +
' tabindex="1" gf-dropdown="menuItems" data-toggle="dropdown"' + ' tabindex="1" gf-dropdown="menuItems" data-toggle="dropdown"' +
' ><i class="fa fa-plus"></i></a>'; ' ><i class="fa fa-plus"></i></a>';
...@@ -137,9 +137,15 @@ export function dropdownTypeahead2($compile) { ...@@ -137,9 +137,15 @@ export function dropdownTypeahead2($compile) {
menuItems: '=dropdownTypeahead2', menuItems: '=dropdownTypeahead2',
dropdownTypeaheadOnSelect: '&dropdownTypeaheadOnSelect', dropdownTypeaheadOnSelect: '&dropdownTypeaheadOnSelect',
model: '=ngModel', model: '=ngModel',
buttonTemplateClass: '@',
}, },
link: ($scope, elem, attrs) => { link: ($scope, elem, attrs) => {
const $input = $(inputTemplate); const $input = $(inputTemplate);
if (!$scope.buttonTemplateClass) {
$scope.buttonTemplateClass = 'gf-form-input';
}
const $button = $(buttonTemplate); const $button = $(buttonTemplate);
const timeoutId = { const timeoutId = {
blur: null, blur: null,
......
...@@ -45,8 +45,10 @@ ...@@ -45,8 +45,10 @@
<div class="gf-form"> <div class="gf-form">
<label class="dropdown" <label class="dropdown"
dropdown-typeahead="ctrl.selectMenu" dropdown-typeahead2="ctrl.selectMenu"
dropdown-typeahead-on-select="ctrl.addSelectPart(selectParts, $item, $subItem)"> dropdown-typeahead-on-select="ctrl.addSelectPart(selectParts, $item, $subItem)"
button-template-class="gf-form-label query-part"
>
</label> </label>
</div> </div>
......
...@@ -45,8 +45,10 @@ ...@@ -45,8 +45,10 @@
<div class="gf-form"> <div class="gf-form">
<label class="dropdown" <label class="dropdown"
dropdown-typeahead="ctrl.selectMenu" dropdown-typeahead2="ctrl.selectMenu"
dropdown-typeahead-on-select="ctrl.addSelectPart(selectParts, $item, $subItem)"> dropdown-typeahead-on-select="ctrl.addSelectPart(selectParts, $item, $subItem)"
button-template-class="gf-form-label query-part"
>
</label> </label>
</div> </div>
......
...@@ -11,7 +11,7 @@ export function SeriesOverridesCtrl($scope, $element, popoverSrv) { ...@@ -11,7 +11,7 @@ export function SeriesOverridesCtrl($scope, $element, popoverSrv) {
const option = { const option = {
text: name, text: name,
propertyName: propertyName, propertyName: propertyName,
index: $scope.overrideMenu.lenght, index: $scope.overrideMenu.length,
values: values, values: values,
submenu: _.map(values, value => { submenu: _.map(values, value => {
return { text: String(value), value: value }; return { text: String(value), value: value };
......
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