File tree Expand file tree Collapse file tree 2 files changed +20
-5
lines changed Expand file tree Collapse file tree 2 files changed +20
-5
lines changed Original file line number Diff line number Diff line change 11< div class ="md-slider-track ">
2- < div class ="md-slider-track-fill " [style.flexBasis] ="percent | percent "> </ div >
3- < div class ="md-slider-ticks-container " [style.marginLeft] ="-halfTickIntervalPercent | percent ">
4- < div class ="md-slider-ticks " [style.marginLeft] ="halfTickIntervalPercent | percent "
5- [style.backgroundSize] ="(tickIntervalPercent | percent) + ' 2px' "> </ div >
2+ < div class ="md-slider-track-fill " [style.flexBasis] ="trackFillFlexBasis "> </ div >
3+ < div class ="md-slider-ticks-container " [style.marginLeft] ="ticksContainerMarginLeft ">
4+ < div class ="md-slider-ticks " [style.marginLeft] ="ticksMarginLeft "
5+ [style.backgroundSize] ="ticksBackgroundSize "> </ div >
66 </ div >
77 < div class ="md-slider-thumb-container ">
88 < div class ="md-slider-thumb "> </ div >
Original file line number Diff line number Diff line change @@ -116,7 +116,6 @@ export class MdSlider implements ControlValueAccessor {
116116 private _tickIntervalPercent : number = 0 ;
117117
118118 get tickIntervalPercent ( ) { return this . _tickIntervalPercent ; }
119- get halfTickIntervalPercent ( ) { return this . _tickIntervalPercent / 2 ; }
120119
121120 /** The percentage of the slider that coincides with the value. */
122121 private _percent : number = 0 ;
@@ -169,6 +168,22 @@ export class MdSlider implements ControlValueAccessor {
169168 this . _percent = this . _calculatePercentage ( this . value ) ;
170169 }
171170
171+ get trackFillFlexBasis ( ) {
172+ return this . percent * 100 + '%' ;
173+ }
174+
175+ get ticksMarginLeft ( ) {
176+ return this . tickIntervalPercent / 2 * 100 + '%' ;
177+ }
178+
179+ get ticksContainerMarginLeft ( ) {
180+ return '-' + this . ticksMarginLeft ;
181+ }
182+
183+ get ticksBackgroundSize ( ) {
184+ return this . tickIntervalPercent * 100 + '% 2px' ;
185+ }
186+
172187 constructor ( elementRef : ElementRef ) {
173188 this . _renderer = new SliderRenderer ( elementRef ) ;
174189 }
You can’t perform that action at this time.
0 commit comments