Skip to content

Commit 3b18eb8

Browse files
committed
Added exact positioning of ticks, by using absolute position on them
1 parent 3173af6 commit 3b18eb8

File tree

7 files changed

+17
-11
lines changed

7 files changed

+17
-11
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "tefdos-angularjs-slider",
3-
"version": "5.4.4",
3+
"version": "5.4.5",
44
"homepage": "https://github.com/angular-slider/angularjs-slider",
55
"authors": [
66
"Rafal Zajac <[email protected]>",

dist/rzslider.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*! angularjs-slider - v5.4.3 -
22
(c) Rafal Zajac <[email protected]>, Valentin Hervieu <[email protected]>, Jussi Saarivirta <[email protected]>, Angelin Sirbu <[email protected]> -
33
https://github.com/angular-slider/angularjs-slider -
4-
2016-09-01 */
4+
2016-09-08 */
55
.rzslider {
66
position: relative;
77
display: inline-block;
@@ -145,6 +145,7 @@
145145
}
146146

147147
.rzslider .rz-ticks .rz-tick {
148+
position: absolute;
148149
width: 10px;
149150
height: 10px;
150151
text-align: center;

dist/rzslider.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*! angularjs-slider - v5.4.3 -
22
(c) Rafal Zajac <[email protected]>, Valentin Hervieu <[email protected]>, Jussi Saarivirta <[email protected]>, Angelin Sirbu <[email protected]> -
33
https://github.com/angular-slider/angularjs-slider -
4-
2016-09-01 */
4+
2016-09-08 */
55
/*jslint unparam: true */
66
/*global angular: false, console: false, define, module */
77
(function(root, factory) {
@@ -74,7 +74,8 @@
7474
customTemplateScope: null,
7575
// CUSTOM CHANGES
7676
disableBarClick: false,
77-
doubleSlider: false
77+
doubleSlider: false,
78+
ticksPadding: 0 // wrapper element padding to position the ticks appropriately
7879
};
7980
var globalOptions = {};
8081

@@ -944,6 +945,7 @@
944945
'background-color': this.getTickColor(value)
945946
}
946947
}
948+
tick.style['left'] = this.valueToOffset(value) + this.options.ticksPadding + 'px';
947949
if (this.options.ticksTooltip) {
948950
tick.tooltip = this.options.ticksTooltip(value);
949951
tick.tooltipPlacement = this.options.vertical ? 'right' : 'top';
@@ -1920,7 +1922,7 @@
19201922
if(newMinValue < this.options.minLimit) newMinValue = this.options.minLimit;
19211923
if(newMaxValue > this.options.maxLimit) newMaxValue = this.options.maxLimit;
19221924
}
1923-
1925+
19241926
this.positionTrackingBar(newMinValue, newMaxValue);
19251927
},
19261928

dist/rzslider.min.css

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/rzslider.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/rzslider.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@
7878
customTemplateScope: null,
7979
// CUSTOM CHANGES
8080
disableBarClick: false,
81-
doubleSlider: false
81+
doubleSlider: false,
82+
ticksPadding: 0 // wrapper element padding to position the ticks appropriately
8283
};
8384
var globalOptions = {};
8485

@@ -948,6 +949,7 @@
948949
'background-color': this.getTickColor(value)
949950
}
950951
}
952+
tick.style['left'] = this.valueToOffset(value) + this.options.ticksPadding + 'px';
951953
if (this.options.ticksTooltip) {
952954
tick.tooltip = this.options.ticksTooltip(value);
953955
tick.tooltipPlacement = this.options.vertical ? 'right' : 'top';
@@ -1924,7 +1926,7 @@
19241926
if(newMinValue < this.options.minLimit) newMinValue = this.options.minLimit;
19251927
if(newMaxValue > this.options.maxLimit) newMaxValue = this.options.maxLimit;
19261928
}
1927-
1929+
19281930
this.positionTrackingBar(newMinValue, newMaxValue);
19291931
},
19301932

src/rzslider.less

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@
144144
height: @ticksHeight;
145145
background: @ticksColor;
146146
border-radius: 50%;
147+
position: absolute;
147148
&.rz-selected {
148149
background: @selectedTicksColor;
149150
}

0 commit comments

Comments
 (0)