fix(slider): hide ticks when slider is disabled (#2687)

* fix(slider): hide ticks when slider is disabled

* No longer shows the ticks on hover, when the slider is disabled.

* Address feedback
This commit is contained in:
Paul Gschwendtner
2017-01-20 18:37:38 +01:00
committed by mmalerba
parent 416f56f6dc
commit e9ec8ab91c
3 changed files with 9 additions and 3 deletions
+1 -1
View File
@@ -9,7 +9,7 @@ Label <md-slider #slidey></md-slider>
<input [(ngModel)]="max">
<h1>Disabled Slider</h1>
<md-slider disabled [(ngModel)]="disabledValue"></md-slider>
<md-slider disabled [(ngModel)]="disabledValue" [tickInterval]="1"></md-slider>
<input [(ngModel)]="disabledValue">
<h1>Slider with set value</h1>
+7 -1
View File
@@ -72,6 +72,11 @@ md-slider {
transition: opacity $swift-ease-out-duration $swift-ease-out-timing-function;
}
// TODO(mmalerba): Simplify css to avoid unnecessary selectors.
.md-slider-disabled .md-slider-ticks {
opacity: 0;
}
.md-slider-thumb-container {
position: absolute;
z-index: 1;
@@ -127,8 +132,9 @@ md-slider {
}
// Slider with ticks.
// Slider with ticks when not disabled.
.md-slider-has-ticks {
.md-slider-wrapper::after {
content: '';
position: absolute;
+1 -1
View File
@@ -94,7 +94,7 @@ export class MdSliderChange {
'[class.md-slider-thumb-label-showing]': 'thumbLabel',
'[class.md-slider-vertical]': 'vertical',
'[class.md-slider-min-value]': '_isMinValue',
'[class.md-slider-hide-last-tick]': '_isMinValue && _thumbGap && invertAxis',
'[class.md-slider-hide-last-tick]': '_isMinValue && _thumbGap && invertAxis || disabled',
},
templateUrl: 'slider.html',
styleUrls: ['slider.css'],