Skip to content

Commit 10761b5

Browse files
feat(): added option boundPointerLabels
added new option boundPointerLabels (default: true). If it is false - pointer label will not stick to the ends of slider.
1 parent 5e5c94a commit 10761b5

File tree

5 files changed

+13
-11
lines changed

5 files changed

+13
-11
lines changed

dist/rzslider.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*! angularjs-slider - v2.13.0 -
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-04-24 */
4+
2016-05-12 */
55
rzslider {
66
position: relative;
77
display: inline-block;

dist/rzslider.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*! angularjs-slider - v2.13.0 -
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-04-24 */
4+
2016-05-12 */
55
/*jslint unparam: true */
66
/*global angular: false, console: false, define, module */
77
(function(root, factory) {
@@ -62,7 +62,8 @@
6262
onStart: null,
6363
onChange: null,
6464
onEnd: null,
65-
rightToLeft: false
65+
rightToLeft: false,
66+
boundPointerLabels: true
6667
};
6768
var globalOptions = {};
6869

@@ -902,7 +903,7 @@
902903
getHandleLabelPos: function(labelName, newOffset) {
903904
var labelRzsd = this[labelName].rzsd,
904905
nearHandlePos = newOffset - labelRzsd / 2 + this.handleHalfDim,
905-
endOfBarPos = this.barDimension - labelRzsd;
906+
endOfBarPos = this.options.boundPointerLabels ? this.barDimension - labelRzsd : Infinity;
906907

907908
if (this.options.rightToLeft && labelName === 'minLab' || !this.options.rightToLeft && labelName === 'maxLab') {
908909
return Math.min(nearHandlePos, endOfBarPos);
@@ -1105,7 +1106,7 @@
11051106
this.selBar.rzsp + this.selBar.rzsd / 2 - this.cmbLab.rzsd / 2,
11061107
0
11071108
),
1108-
this.barDimension - this.cmbLab.rzsd
1109+
this.options.boundPointerLabels ? this.barDimension - this.cmbLab.rzsd : Infinity
11091110
);
11101111
this.setPosition(this.cmbLab, pos);
11111112
this.hideEl(this.minLab);

dist/rzslider.min.css

Lines changed: 1 addition & 1 deletion
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 & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@
6666
onStart: null,
6767
onChange: null,
6868
onEnd: null,
69-
rightToLeft: false
69+
rightToLeft: false,
70+
boundPointerLabels: true
7071
};
7172
var globalOptions = {};
7273

@@ -906,7 +907,7 @@
906907
getHandleLabelPos: function(labelName, newOffset) {
907908
var labelRzsd = this[labelName].rzsd,
908909
nearHandlePos = newOffset - labelRzsd / 2 + this.handleHalfDim,
909-
endOfBarPos = this.barDimension - labelRzsd;
910+
endOfBarPos = this.options.boundPointerLabels ? this.barDimension - labelRzsd : Infinity;
910911

911912
if (this.options.rightToLeft && labelName === 'minLab' || !this.options.rightToLeft && labelName === 'maxLab') {
912913
return Math.min(nearHandlePos, endOfBarPos);
@@ -1109,7 +1110,7 @@
11091110
this.selBar.rzsp + this.selBar.rzsd / 2 - this.cmbLab.rzsd / 2,
11101111
0
11111112
),
1112-
this.barDimension - this.cmbLab.rzsd
1113+
this.options.boundPointerLabels ? this.barDimension - this.cmbLab.rzsd : Infinity
11131114
);
11141115
this.setPosition(this.cmbLab, pos);
11151116
this.hideEl(this.minLab);

0 commit comments

Comments
 (0)