Przeglądaj źródła

Fix for selecting template variable value from typeahead using enter key, Closes #765

Torkel Ödegaard 11 lat temu
rodzic
commit
e729b3734d

+ 2 - 2
src/app/directives/templateParamSelector.js

@@ -40,9 +40,9 @@ function (angular, app, _, $) {
             minLength: 0,
             minLength: 0,
             items: 10,
             items: 10,
             updater: function(value) {
             updater: function(value) {
-              updateVariableValue(value);
+              $input.val(value);
               $input.trigger('blur');
               $input.trigger('blur');
-              return '';
+              return value;
             }
             }
           });
           });
 
 

+ 3 - 1
src/app/partials/submenu.html

@@ -21,7 +21,9 @@
 						<strong>VARIABLES</strong>
 						<strong>VARIABLES</strong>
 					</li>
 					</li>
 					<li ng-repeat-start="variable in variables" class="grafana-target-segment template-param-name">
 					<li ng-repeat-start="variable in variables" class="grafana-target-segment template-param-name">
-						{{variable.name}}:
+						<span class="template-variable ">
+						${{variable.name}}:
+						</span>
 					</li>
 					</li>
 
 
 					<li ng-repeat-end template-param-selector>
 					<li ng-repeat-end template-param-selector>

+ 3 - 1
src/app/partials/templating_editor.html

@@ -23,7 +23,9 @@
 					<table class="grafana-options-table">
 					<table class="grafana-options-table">
 						<tr ng-repeat="variable in variables">
 						<tr ng-repeat="variable in variables">
 							<td style="width: 1%">
 							<td style="width: 1%">
-								[[{{variable.name}}]]
+								<span class="template-variable">
+									${{variable.name}}
+								</span>
 							</td>
 							</td>
 							<td class="max-width" style="max-width: 200px;">
 							<td class="max-width" style="max-width: 200px;">
 								{{variable.query}}
 								{{variable.query}}