Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c698477

Browse files
author
Valentin Hervieu
committed
fix(highLab): Fix high label positioning when size is different than the ceil one.
1 parent 4c55de2 commit c698477

File tree

10 files changed

+44
-11
lines changed

10 files changed

+44
-11
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 2.7.1 (2016-02-06)
2+
## Fix
3+
- Fix high label positioning when size is different than the ceil one.
4+
15
# 2.7.0 (2016-02-06)
26
## Features
37
- Add an `enforceStep` option (defaults to true) (#246).

bower.json

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

demo/demo.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,26 @@ app.controller('MainCtrl', function($scope, $rootScope, $timeout, $modal) {
135135
}
136136
};
137137

138+
//Slider config with custom display function using html formatting
139+
$scope.slider_translate_html = {
140+
minValue: 100,
141+
maxValue: 400,
142+
options: {
143+
floor: 0,
144+
ceil: 500,
145+
translate: function(value, sliderId, label) {
146+
switch (label) {
147+
case 'model':
148+
return '<b>Min price:</b> $' + value;
149+
case 'high':
150+
return '<b>Max price:</b> $' + value;
151+
default:
152+
return '$' + value
153+
}
154+
}
155+
}
156+
};
157+
138158
//Slider config with steps array of letters
139159
$scope.slider_alphabet = {
140160
value: 0,

demo/index.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,15 @@ <h2>Slider with custom display function</h2>
115115
></rzslider>
116116
</article>
117117

118+
<article>
119+
<h2>Slider with custom display function using html formatting</h2>
120+
<rzslider
121+
rz-slider-model="slider_translate_html.minValue"
122+
rz-slider-high="slider_translate_html.maxValue"
123+
rz-slider-options="slider_translate_html.options"
124+
></rzslider>
125+
</article>
126+
118127
<article>
119128
<h2>Slider with Alphabet</h2>
120129
<rzslider

dist/rzslider.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! angularjs-slider - v2.7.0 -
1+
/*! angularjs-slider - v2.7.1 -
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 -
44
2016-02-06 */

dist/rzslider.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! angularjs-slider - v2.7.0 -
1+
/*! angularjs-slider - v2.7.1 -
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 -
44
2016-02-06 */
@@ -885,7 +885,7 @@
885885
newOffset - this.minLab.rzsd / 2 + this.handleHalfDim,
886886
0
887887
),
888-
this.barDimension - this.ceilLab.rzsd
888+
this.barDimension - this.minLab.rzsd
889889
);
890890
this.setPosition(this.minLab, pos);
891891

@@ -901,7 +901,7 @@
901901
updateHighHandle: function(newOffset) {
902902
this.setPosition(this.maxH, newOffset);
903903
this.translateFn(this.scope.rzSliderHigh, this.maxLab, 'high');
904-
var pos = Math.min(newOffset - this.maxLab.rzsd / 2 + this.handleHalfDim, this.barDimension - this.ceilLab.rzsd);
904+
var pos = Math.min(newOffset - this.maxLab.rzsd / 2 + this.handleHalfDim, this.barDimension - this.maxLab.rzsd);
905905
this.setPosition(this.maxLab, pos);
906906

907907
this.shFloorCeil();

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.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angularjs-slider",
3-
"version": "2.7.0",
3+
"version": "2.7.1",
44
"description": "AngularJS slider directive with no external dependencies. Mobile friendly!.",
55
"main": "dist/rzslider.js",
66
"repository": {

src/rzslider.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -889,7 +889,7 @@
889889
newOffset - this.minLab.rzsd / 2 + this.handleHalfDim,
890890
0
891891
),
892-
this.barDimension - this.ceilLab.rzsd
892+
this.barDimension - this.minLab.rzsd
893893
);
894894
this.setPosition(this.minLab, pos);
895895

@@ -905,7 +905,7 @@
905905
updateHighHandle: function(newOffset) {
906906
this.setPosition(this.maxH, newOffset);
907907
this.translateFn(this.scope.rzSliderHigh, this.maxLab, 'high');
908-
var pos = Math.min(newOffset - this.maxLab.rzsd / 2 + this.handleHalfDim, this.barDimension - this.ceilLab.rzsd);
908+
var pos = Math.min(newOffset - this.maxLab.rzsd / 2 + this.handleHalfDim, this.barDimension - this.maxLab.rzsd);
909909
this.setPosition(this.maxLab, pos);
910910

911911
this.shFloorCeil();

0 commit comments

Comments
 (0)