Skip to content

Commit da93878

Browse files
committed
Add a boolean-option so the limit-numbers can be displayed or not. Default value should be that they are displayed
1 parent d9e8a6a commit da93878

File tree

6 files changed

+29
-7
lines changed

6 files changed

+29
-7
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ $scope.priceSlider = {
9090

9191
> The precision to display values with. The `toFixed()` is used internally for this.
9292
93+
**rz-slider-hide-limit-labels**
94+
95+
> Set to true to hide min / max labels
96+
9397
**rz-slider-translate**
9498

9599
> Custom translate function. Use this if you want to translate values displayed on the slider. For example if you want to display dollar amounts instead of just numbers do this:

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": "0.1.9",
3+
"version": "0.1.10",
44
"homepage": "https://github.com/rzajac/angularjs-slider",
55
"authors": [
66
"Rafal Zajac <[email protected]>",

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": "jusas-angularjs-slider",
3-
"version": "0.1.9",
3+
"version": "0.1.10",
44
"description": "AngularJS slider directive with no external dependencies. Mobile friendly!.",
55
"main": "rzslider.js",
66
"repository": {

rzslider.js

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* (c) Rafal Zajac <[email protected]>
55
* http://github.com/rzajac/angularjs-slider
66
*
7-
* Version: v0.1.9
7+
* Version: v0.1.10
88
*
99
* Licensed under the MIT license
1010
*/
@@ -146,6 +146,13 @@ function throttle(func, wait, options) {
146146
*/
147147
this.maxValue = 0;
148148

149+
/**
150+
* Hide limit labels
151+
*
152+
* @type {boolean}
153+
*/
154+
this.hideLimitLabels = !!attributes.rzSliderHideLimitLabels || false;
155+
149156
/**
150157
* The delta between min and max value
151158
*
@@ -432,6 +439,14 @@ function throttle(func, wait, options) {
432439
this.maxLab.rzsl = 0;
433440
this.cmbLab.rzsl = 0;
434441

442+
if(this.hideLimitLabels)
443+
{
444+
this.flrLab.rzAlwaysHide = true;
445+
this.ceilLab.rzAlwaysHide = true;
446+
this.hideEl(this.flrLab);
447+
this.hideEl(this.ceilLab);
448+
}
449+
435450
// Remove stuff not needed in single slider
436451
if( ! this.range)
437452
{
@@ -693,6 +708,8 @@ function throttle(func, wait, options) {
693708
*/
694709
showEl: function (element)
695710
{
711+
if(!!element.rzAlwaysHide) return element;
712+
696713
return element.css({opacity: 1});
697714
},
698715

@@ -920,7 +937,8 @@ function throttle(func, wait, options) {
920937
rzSliderPrecision: '@',
921938
rzSliderModel: '=?',
922939
rzSliderHigh: '=?',
923-
rzSliderTranslate: '&'
940+
rzSliderTranslate: '&',
941+
rzSliderHideLimitLabels: '=?'
924942
},
925943
template: '<span class="rz-bar"></span>' + // 0 The slider bar
926944
'<span class="rz-bar rz-selection"></span>' + // 1 Highlight between two handles

0 commit comments

Comments
 (0)