Commit 0414639f authored by Rafal Zajac's avatar Rafal Zajac

Update

parent d3378d09
...@@ -81,7 +81,7 @@ rzslider span.rz-pointer:hover:after { ...@@ -81,7 +81,7 @@ rzslider span.rz-pointer:hover:after {
} }
rzslider span.rz-pointer.rz-active:after { rzslider span.rz-pointer.rz-active:after {
background-color: #ffffff; background-color: #451aff;
} }
rzslider span.rz-bubble { rzslider span.rz-bubble {
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* (c) Rafal Zajac <rzajac@gmail.com> * (c) Rafal Zajac <rzajac@gmail.com>
* http://github.com/rzajac/angularjs-slider * http://github.com/rzajac/angularjs-slider
* *
* Version: v0.1.9 * Version: v0.1.11
* *
* Licensed under the MIT license * Licensed under the MIT license
*/ */
...@@ -146,6 +146,13 @@ function throttle(func, wait, options) { ...@@ -146,6 +146,13 @@ function throttle(func, wait, options) {
*/ */
this.maxValue = 0; this.maxValue = 0;
/**
* Hide limit labels
*
* @type {boolean}
*/
this.hideLimitLabels = !!attributes.rzSliderHideLimitLabels || false;
/** /**
* The delta between min and max value * The delta between min and max value
* *
...@@ -432,6 +439,14 @@ function throttle(func, wait, options) { ...@@ -432,6 +439,14 @@ function throttle(func, wait, options) {
this.maxLab.rzsl = 0; this.maxLab.rzsl = 0;
this.cmbLab.rzsl = 0; this.cmbLab.rzsl = 0;
if(this.hideLimitLabels)
{
this.flrLab.rzAlwaysHide = true;
this.ceilLab.rzAlwaysHide = true;
this.hideEl(this.flrLab);
this.hideEl(this.ceilLab);
}
// Remove stuff not needed in single slider // Remove stuff not needed in single slider
if( ! this.range) if( ! this.range)
{ {
...@@ -693,6 +708,8 @@ function throttle(func, wait, options) { ...@@ -693,6 +708,8 @@ function throttle(func, wait, options) {
*/ */
showEl: function (element) showEl: function (element)
{ {
if(!!element.rzAlwaysHide) return element;
return element.css({opacity: 1}); return element.css({opacity: 1});
}, },
...@@ -745,7 +762,7 @@ function throttle(func, wait, options) { ...@@ -745,7 +762,7 @@ function throttle(func, wait, options) {
*/ */
valueToOffset: function(val) valueToOffset: function(val)
{ {
return (val - this.minValue) * this.maxLeft / this.valueRange; return (Math.ceil(val) - this.minValue) * this.maxLeft / this.valueRange;
}, },
/** /**
...@@ -756,7 +773,7 @@ function throttle(func, wait, options) { ...@@ -756,7 +773,7 @@ function throttle(func, wait, options) {
*/ */
offsetToValue: function(offset) offsetToValue: function(offset)
{ {
return (offset / this.maxLeft) * this.valueRange + this.minValue; return Math.ceil( (offset / this.maxLeft) * this.valueRange + this.minValue );
}, },
// Events // Events
...@@ -912,7 +929,7 @@ function throttle(func, wait, options) { ...@@ -912,7 +929,7 @@ function throttle(func, wait, options) {
.directive('rzslider', ['RzSlider', function(Slider) .directive('rzslider', ['RzSlider', function(Slider)
{ {
return { return {
restrict: 'EA', restrict: 'E',
scope: { scope: {
rzSliderFloor: '=?', rzSliderFloor: '=?',
rzSliderCeil: '=?', rzSliderCeil: '=?',
...@@ -920,7 +937,8 @@ function throttle(func, wait, options) { ...@@ -920,7 +937,8 @@ function throttle(func, wait, options) {
rzSliderPrecision: '@', rzSliderPrecision: '@',
rzSliderModel: '=?', rzSliderModel: '=?',
rzSliderHigh: '=?', rzSliderHigh: '=?',
rzSliderTranslate: '&' rzSliderTranslate: '&',
rzSliderHideLimitLabels: '=?'
}, },
template: '<span class="rz-bar"></span>' + // 0 The slider bar template: '<span class="rz-bar"></span>' + // 0 The slider bar
'<span class="rz-bar rz-selection"></span>' + // 1 Highlight between two handles '<span class="rz-bar rz-selection"></span>' + // 1 Highlight between two handles
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment