Commit 6e8d5cd8 by Torkel Ödegaard

fix(opentsdb): blur event triggered twice for metric selector, caused double…

fix(opentsdb): blur event triggered twice for metric selector, caused double query to opentsdb after metric name change
parent 48686cf9
...@@ -42,15 +42,9 @@ ...@@ -42,15 +42,9 @@
Metric Metric
</li> </li>
<li> <li>
<input type="text" <input type="text" class="input-large tight-form-input" ng-model="target.metric"
class="input-large tight-form-input" spellcheck='false' bs-typeahead="suggestMetrics" placeholder="metric name" data-min-length=0 data-items=100
ng-model="target.metric" ng-blur="targetBlur()">
spellcheck='false'
bs-typeahead="suggestMetrics"
placeholder="metric name"
data-min-length=0 data-items=100
ng-model-onblur
ng-change="targetBlur()">
</input> </input>
<a bs-tooltip="target.errors.metric" style="color: rgb(229, 189, 28)" ng-show="target.errors.metric"> <a bs-tooltip="target.errors.metric" style="color: rgb(229, 189, 28)" ng-show="target.errors.metric">
<i class="fa fa-warning"></i> <i class="fa fa-warning"></i>
...@@ -97,7 +91,7 @@ ...@@ -97,7 +91,7 @@
ng-model="target.downsampleInterval" ng-model="target.downsampleInterval"
ng-model-onblur ng-model-onblur
ng-change="targetBlur()" ng-change="targetBlur()"
placeholder="interval (empty = auto)"> placeholder="interval (empty = auto)"></input>
</li> </li>
<li class="tight-form-item"> <li class="tight-form-item">
...@@ -117,9 +111,9 @@ ...@@ -117,9 +111,9 @@
</ul> </ul>
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>
<div class="tight-form"> <div class="tight-form">
<ul class="tight-form-list" role="menu"> <ul class="tight-form-list" role="menu">
<li class="tight-form-item tight-form-align" style="width: 86px"> <li class="tight-form-item tight-form-align" style="width: 86px">
Tags Tags
...@@ -138,19 +132,13 @@ ...@@ -138,19 +132,13 @@
</li> </li>
<li ng-show="addTagMode"> <li ng-show="addTagMode">
<input type="text" class="input-small tight-form-input" spellcheck='false'
bs-typeahead="suggestTagKeys" data-min-length=0 data-items=100
ng-model="target.currentTagKey" placeholder="key"></input>
<input type="text" class="input-small tight-form-input" <input type="text" class="input-small tight-form-input"
spellcheck='false' spellcheck='false' bs-typeahead="suggestTagValues"
bs-typeahead="suggestTagKeys" data-min-length=0 data-items=100 ng-model="target.currentTagValue" placeholder="value">
data-min-length=0 data-items=100
ng-model="target.currentTagKey"
placeholder="key">
<input type="text"
class="input-small tight-form-input"
spellcheck='false'
bs-typeahead="suggestTagValues"
data-min-length=0 data-items=100
ng-model="target.currentTagValue"
placeholder="value">
</input> </input>
<a ng-click="addTag()"> <a ng-click="addTag()">
add tag add tag
...@@ -163,9 +151,9 @@ ...@@ -163,9 +151,9 @@
</li> </li>
</ul> </ul>
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>
<div class="tight-form"> <div class="tight-form">
<ul class="tight-form-list" role="menu"> <ul class="tight-form-list" role="menu">
<li class="tight-form-item tight-form-align" style="width: 86px"> <li class="tight-form-item tight-form-align" style="width: 86px">
<editor-checkbox text="Rate" model="target.shouldComputeRate" change="targetBlur()"></editor-checkbox> <editor-checkbox text="Rate" model="target.shouldComputeRate" change="targetBlur()"></editor-checkbox>
...@@ -180,29 +168,21 @@ ...@@ -180,29 +168,21 @@
</li> </li>
<li ng-hide="!target.isCounter"> <li ng-hide="!target.isCounter">
<input type="text" class="tight-form-input input-small" <input type="text" class="tight-form-input input-small" ng-disabled="!target.shouldComputeRate"
ng-disabled="!target.shouldComputeRate" ng-model="target.counterMax" spellcheck='false'
ng-model="target.counterMax" placeholder="max value" ng-model-onblur
spellcheck='false'
placeholder="max value"
ng-model-onblur
ng-blur="targetBlur()"></input> ng-blur="targetBlur()"></input>
</li> </li>
<li class="tight-form-item" ng-hide="!target.isCounter"> <li class="tight-form-item" ng-hide="!target.isCounter">
Reset Value: Reset Value:
</li> </li>
<li ng-hide="!target.isCounter"> <li ng-hide="!target.isCounter">
<input type="text" class="tight-form-input input-small" <input type="text" class="tight-form-input input-small" ng-disabled="!target.shouldComputeRate"
ng-disabled="!target.shouldComputeRate" ng-model="target.counterResetValue" spellcheck='false'
ng-model="target.counterResetValue" placeholder="reset value" ng-model-onblur
spellcheck='false'
placeholder="reset value"
ng-model-onblur
ng-blur="targetBlur()"></input> ng-blur="targetBlur()"></input>
</li> </li>
</ul> </ul>
<div class="clearfix"></div> <div class="clearfix"></div>
</div>
</div>
</div> </div>
...@@ -21,10 +21,6 @@ function (angular, _, kbn) { ...@@ -21,10 +21,6 @@ function (angular, _, kbn) {
if (!$scope.target.downsampleAggregator) { if (!$scope.target.downsampleAggregator) {
$scope.target.downsampleAggregator = 'avg'; $scope.target.downsampleAggregator = 'avg';
} }
$scope.$on('typeahead-updated', function() {
$timeout($scope.targetBlur);
});
}; };
$scope.targetBlur = function() { $scope.targetBlur = function() {
......
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