ux(timepicker): fix css for the timepicker

This commit is contained in:
bergquist 2016-02-18 18:59:50 +01:00
parent ed58474c37
commit d769f6c084
4 changed files with 67 additions and 20 deletions

View File

@ -1,37 +1,52 @@
<div class="row pull-right"> <div class="row pull-right">
<form name="timeForm" class="gf-timepicker-absolute-section"> <form name="timeForm" class="gf-timepicker-absolute-section">
<h3>Time range</h3> <h3>Time range</h3>
<label class="small">From:</label> <label class="small">From:</label>
<div class="input-prepend"> <div class="gf-form-inline">
<input type="text" class="input-large" ng-model="ctrl.timeRaw.from" input-datetime> <div class="gf-form gf-size-max-xxxl">
<button class="btn btn-primary" type="button" ng-click="openFromPicker=!openFromPicker"> <input type="text" class="gf-form-input input-large" ng-model="ctrl.timeRaw.from" input-datetime>
<i class="fa fa-calendar"></i> </div>
</button> <div class="gf-form">
<button class="btn gf-form-btn btn-primary" type="button" ng-click="openFromPicker=!openFromPicker">
<i class="fa fa-calendar"></i>
</button>
</div>
</div> </div>
<div ng-if="openFromPicker"> <div ng-if="openFromPicker">
<datepicker ng-model="ctrl.absolute.fromJs" class="gf-timepicker-component" show-weeks="false" ng-change="ctrl.absoluteFromChanged()"></datepicker> <datepicker ng-model="ctrl.absolute.fromJs" class="gf-timepicker-component" show-weeks="false" ng-change="ctrl.absoluteFromChanged()"></datepicker>
</div> </div>
<label class="small">To:</label> <label class="small">To:</label>
<div class="input-prepend"> <div class="gf-form-inline">
<input type="text" class="input-large" ng-model="ctrl.timeRaw.to" input-datetime> <div class="gf-form gf-size-max-xxxl">
<button class="btn btn-primary" type="button" ng-click="openToPicker=!openToPicker"> <input type="text" class="gf-form-input input-large" ng-model="ctrl.timeRaw.to" input-datetime>
<i class="fa fa-calendar"></i> </div>
</button> <div class="gf-form">
<button class="btn gf-form-btn btn-primary" type="button" ng-click="openToPicker=!openToPicker">
<i class="fa fa-calendar"></i>
</button>
</div>
</div> </div>
<div ng-if="openToPicker"> <div ng-if="openToPicker">
<datepicker ng-model="ctrl.absolute.toJs" class="gf-timepicker-component" show-weeks="false" ng-change="ctrl.absoluteToChanged()"></datepicker> <datepicker ng-model="ctrl.absolute.toJs" class="gf-timepicker-component" show-weeks="false" ng-change="ctrl.absoluteToChanged()"></datepicker>
</div> </div>
<label class="small">Refreshing every:</label>
<select ng-model="ctrl.refresh.value" class='input-medium' ng-options="f.value as f.text for f in ctrl.refresh.options">
</select>
<button type="submit" class="btn btn-primary" ng-click="ctrl.applyCustom();" ng-disabled="!timeForm.$valid">
Apply <label class="small">Refreshing every:</label>
</button> <div class="gf-form-inline">
<div class="gf-form gf-size-max-xxxl">
<select ng-model="ctrl.refresh.value" class="gf-form-input input-medium" ng-options="f.value as f.text for f in ctrl.refresh.options"></select>
</div>
<div class="gf-form">
<button type="submit" class="btn gf-form-btn btn-primary" ng-click="ctrl.applyCustom();" ng-disabled="!timeForm.$valid">Apply</button>
</div>
</div>
</form> </form>
<div class="gf-timepicker-relative-section"> <div class="gf-timepicker-relative-section">

View File

@ -15,6 +15,7 @@
@import "base/forms"; @import "base/forms";
@import "base/fonts"; @import "base/fonts";
@import "base/grid"; @import "base/grid";
@import "base/font_awesome";
// UTILS // UTILS
@import "utils/utils"; @import "utils/utils";

View File

@ -21,10 +21,10 @@
} }
.gf-timepicker-absolute-section { .gf-timepicker-absolute-section {
width: 300px; width: 290px;
float: left; float: left;
border-right: 1px solid $divider-border-color; border-right: 1px solid $divider-border-color;
padding: 0 0 0 20px; padding: 0 10px;
select { select {
width: 183px; width: 183px;
margin-bottom: 0; margin-bottom: 0;
@ -47,7 +47,7 @@
.gf-timepicker-relative-section { .gf-timepicker-relative-section {
padding: 0 20px 0 30px; padding: 0 20px 0 30px;
min-height: 258px; min-height: 237px;
float: left; float: left;
ul { ul {
list-style: none; list-style: none;
@ -66,11 +66,14 @@
.gf-timepicker-component { .gf-timepicker-component {
margin-bottom: 10px; margin-bottom: 10px;
td {
padding: 1px;
}
button.btn-sm { button.btn-sm {
@include buttonBackground($btnInverseBackground, $btnInverseBackgroundHighlight); @include buttonBackground($btnInverseBackground, $btnInverseBackgroundHighlight);
background-image: none; background-image: none;
border: none; border: none;
padding: 6px 9px; padding: 6px 10px;
color: $text-color; color: $text-color;
&.active span { &.active span {
color: $blue; color: $blue;
@ -86,3 +89,31 @@
.input-datetime-format { .input-datetime-format {
color: $link-color-disabled color: $link-color-disabled
} }
.fa {
display: inline-block;
font: normal normal normal 14px/1 FontAwesome;
font-size: inherit;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.fa-chevron-left:before {
content: "\f053";
}
.fa-chevron-right:before {
content: "\f054";
}
.glyphicon-chevron-right {
@extend .fa;
@extend .fa-chevron-right;
}
.glyphicon-chevron-left {
@extend .fa;
@extend .fa-chevron-left;
}