mirror of https://github.com/grafana/grafana.git
Added directive element for the new checkboxes
This commit is contained in:
parent
4c59ec815e
commit
4997068a0d
|
|
@ -20,13 +20,18 @@ function (angular, kbn) {
|
|||
|
||||
angular
|
||||
.module('grafana.directives')
|
||||
.directive('tip', function($compile) {
|
||||
.directive('editorOptBool', function($compile) {
|
||||
return {
|
||||
restrict: 'E',
|
||||
link: function(scope, elem, attrs) {
|
||||
var _t = '<i class="grafana-tip icon-'+(attrs.icon||'question-sign')+'" bs-tooltip="\''+
|
||||
kbn.addslashes(elem.text())+'\'"></i>';
|
||||
elem.replaceWith($compile(angular.element(_t))(scope));
|
||||
var template = '<div class="editor-option text-center">' +
|
||||
' <label for="' + attrs.name + '" class="small">' +
|
||||
attrs.text + '</label>' +
|
||||
'<input id="' + attrs.name + '" type="checkbox" ' +
|
||||
' ng-model="' + attrs.model + '"' +
|
||||
' ng-checked="' + attrs.model + '"></input>' +
|
||||
' <label for="' + attrs.name + '" class="cr1"></label>';
|
||||
elem.replaceWith($compile(angular.element(template))(scope));
|
||||
}
|
||||
};
|
||||
});
|
||||
|
|
|
|||
|
|
@ -16,16 +16,8 @@
|
|||
|
||||
<div class="modal-body">
|
||||
<div class="editor-row">
|
||||
<div class="editor-option text-center">
|
||||
<label for="currentTime" class="small">Current time range</label>
|
||||
<input id="currentTime" type="checkbox" ng-model="forCurrent" ng-checked="forCurrent"></input>
|
||||
<label for="currentTime" class="cr1"></label>
|
||||
</div>
|
||||
<div class="editor-option text-center">
|
||||
<label for="toPanel" class="small">To fullscreen panel</label>
|
||||
<input id="toPanel" type="checkbox" ng-model="toPanel" ng-checked="toPanel"></input>
|
||||
<label for="toPanel" class="cr1"></label>
|
||||
</div>
|
||||
<editor-opt-bool name="currentTime" text="Current time range" model="forCurrent"></editor-opt-bool>
|
||||
<editor-opt-bool name="toPanel" text="To this panel only" model="toPanel"></editor-opt-bool>
|
||||
</div>
|
||||
|
||||
<div class="editor-row" style="margin-top: 20px;">
|
||||
|
|
|
|||
Loading…
Reference in New Issue