mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Fixed issue with OpenTSDB editor and checkboxes, Fixes #1559
This commit is contained in:
parent
f817a8ca3c
commit
af9dc4c277
@ -55,4 +55,24 @@ function (angular, kbn) {
|
||||
};
|
||||
});
|
||||
|
||||
angular
|
||||
.module('grafana.directives')
|
||||
.directive('editorCheckbox', function($compile) {
|
||||
return {
|
||||
restrict: 'E',
|
||||
link: function(scope, elem, attrs) {
|
||||
var ngchange = attrs.change ? (' ng-change="' + attrs.change + '"') : '';
|
||||
var tip = attrs.tip ? (' <tip>' + attrs.tip + '</tip>') : '';
|
||||
|
||||
var template = '<label for="' + scope.$id + attrs.model + '" class="checkbox-label">' +
|
||||
attrs.text + tip + '</label>' +
|
||||
'<input class="cr1" id="' + scope.$id + attrs.model + '" type="checkbox" ' +
|
||||
' ng-model="' + attrs.model + '"' + ngchange +
|
||||
' ng-checked="' + attrs.model + '"></input>' +
|
||||
' <label for="' + scope.$id + attrs.model + '" class="cr1"></label>';
|
||||
elem.replaceWith($compile(angular.element(template))(scope));
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
});
|
||||
|
@ -131,10 +131,7 @@
|
||||
</li>
|
||||
|
||||
<li class="tight-form-item">
|
||||
Disable downsampling
|
||||
<input class="cr1" id="target.disableDownsampling" type="checkbox"
|
||||
ng-model="target.disableDownsampling" ng-checked="target.disableDownsampling" ng-change="targetBlur()">
|
||||
<label for="target.disableDownsampling" class="cr1"></label>
|
||||
<editor-checkbox text="Disable downsampling" model="target.disableDownsampling" change="targetBlur()"></editor-checkbox>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
@ -198,17 +195,11 @@
|
||||
</li>
|
||||
|
||||
<li class="tight-form-item" style="width: 86px">
|
||||
Rate
|
||||
<input class="cr1" id="target.shouldComputeRate" type="checkbox"
|
||||
ng-model="target.shouldComputeRate" ng-checked="target.shouldComputeRate" ng-change="targetBlur()">
|
||||
<label for="target.shouldComputeRate" class="cr1"></label>
|
||||
<editor-checkbox text="Rate" model="target.shouldComputeRate" change="targetBlur()"></editor-checkbox>
|
||||
</li>
|
||||
|
||||
<li class="tight-form-item" ng-hide="!target.shouldComputeRate">
|
||||
Counter
|
||||
<input class="cr1" id="target.isCounter" type="checkbox"
|
||||
ng-model="target.isCounter" ng-checked="target.isCounter" ng-change="targetBlur()">
|
||||
<label for="target.isCounter" class="cr1"></label>
|
||||
<editor-checkbox text="Counter" model="target.isCounter" change="targetBlur()"></editor-checkbox>
|
||||
</li>
|
||||
|
||||
<li class="tight-form-item" ng-hide="!target.isCounter">
|
||||
|
@ -17,6 +17,12 @@
|
||||
background: transparent;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.checkbox-label {
|
||||
display: inline;
|
||||
padding-right: 4px;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.spaced-form {
|
||||
|
Loading…
Reference in New Issue
Block a user