Commit e417c3b6 authored by Rafal Zajac's avatar Rafal Zajac

Fix #16

parent a20704a9
{ {
"name": "angularjs-slider", "name": "angularjs-slider",
"version": "0.1.13", "version": "0.1.14",
"homepage": "https://github.com/rzajac/angularjs-slider", "homepage": "https://github.com/rzajac/angularjs-slider",
"authors": [ "authors": [
"Rafal Zajac <rzajac@gmail.com>", "Rafal Zajac <rzajac@gmail.com>",
......
This source diff could not be displayed because it is too large. You can view the blob instead.
/*! jusas-angularjs-slider - v0.1.13 - (c) Rafal Zajac <rzajac@gmail.com>, Jussi Saarivirta <jusasi@gmail.com>, Angelin Sirbu <angelin.sirbu@gmail.com>, https://github.com/rzajac/angularjs-slider.git - 2015-05-23 */ /*! jusas-angularjs-slider - v0.1.14 - (c) Rafal Zajac <rzajac@gmail.com>, Jussi Saarivirta <jusasi@gmail.com>, Angelin Sirbu <angelin.sirbu@gmail.com>, https://github.com/rzajac/angularjs-slider.git - 2015-05-24 */
rzslider{position:relative;display:inline-block;width:100%;height:4px;margin:30px 0 15px 0;vertical-align:middle}rzslider span{position:absolute;display:inline-block;white-space:nowrap}rzslider span.rz-base{width:100%;height:100%;padding:0}rzslider span.rz-bar{z-index:0;width:100%;height:100%;background:#d8e0f3;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px}rzslider span.rz-bar.rz-selection{z-index:1;width:0;background:#0db9f0;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px}rzslider span.rz-pointer{top:-14px;z-index:2;width:32px;height:32px;cursor:pointer;background-color:#0db9f0;-webkit-border-radius:16px;-moz-border-radius:16px;border-radius:16px}rzslider span.rz-pointer:after{position:absolute;top:12px;left:12px;width:8px;height:8px;background:#fff;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;content:''}rzslider span.rz-pointer:hover:after{background-color:#fff}rzslider span.rz-pointer.rz-active:after{background-color:#451aff}rzslider span.rz-bubble{top:-32px;padding:1px 3px;color:#55637d;cursor:default}rzslider span.rz-bubble.rz-selection{top:16px}rzslider span.rz-bubble.rz-limit{color:#55637d} rzslider{position:relative;display:inline-block;width:100%;height:4px;margin:30px 0 15px 0;vertical-align:middle}rzslider span{position:absolute;display:inline-block;white-space:nowrap}rzslider span.rz-base{width:100%;height:100%;padding:0}rzslider span.rz-bar{z-index:0;width:100%;height:100%;background:#d8e0f3;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px}rzslider span.rz-bar.rz-selection{z-index:1;width:0;background:#0db9f0;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px}rzslider span.rz-pointer{top:-14px;z-index:2;width:32px;height:32px;cursor:pointer;background-color:#0db9f0;-webkit-border-radius:16px;-moz-border-radius:16px;border-radius:16px}rzslider span.rz-pointer:after{position:absolute;top:12px;left:12px;width:8px;height:8px;background:#fff;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;content:''}rzslider span.rz-pointer:hover:after{background-color:#fff}rzslider span.rz-pointer.rz-active:after{background-color:#451aff}rzslider span.rz-bubble{top:-32px;padding:1px 3px;color:#55637d;cursor:default}rzslider span.rz-bubble.rz-selection{top:16px}rzslider span.rz-bubble.rz-limit{color:#55637d}
\ No newline at end of file
This diff is collapsed.
{ {
"name": "jusas-angularjs-slider", "name": "jusas-angularjs-slider",
"version": "0.1.13", "version": "0.1.14",
"description": "AngularJS slider directive with no external dependencies. Mobile friendly!.", "description": "AngularJS slider directive with no external dependencies. Mobile friendly!.",
"main": "rzslider.js", "main": "rzslider.js",
"repository": { "repository": {
......
...@@ -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.13 * Version: v0.1.14
* *
* Licensed under the MIT license * Licensed under the MIT license
*/ */
...@@ -575,6 +575,9 @@ function throttle(func, wait, options) { ...@@ -575,6 +575,9 @@ function throttle(func, wait, options) {
*/ */
updateLowHandle: function(newOffset) updateLowHandle: function(newOffset)
{ {
var delta = Math.abs(this.minH.rzsl - newOffset);
if(delta === 0 || delta === 1) return;
this.setLeft(this.minH, newOffset); this.setLeft(this.minH, newOffset);
this.translateFn(this.scope.rzSliderModel, this.minLab); this.translateFn(this.scope.rzSliderModel, this.minLab);
this.setLeft(this.minLab, newOffset - this.minLab.rzsw / 2 + this.handleHalfWidth); this.setLeft(this.minLab, newOffset - this.minLab.rzsw / 2 + this.handleHalfWidth);
...@@ -786,7 +789,7 @@ function throttle(func, wait, options) { ...@@ -786,7 +789,7 @@ function throttle(func, wait, options) {
*/ */
valueToOffset: function(val) valueToOffset: function(val)
{ {
return (Math.ceil(val) - this.minValue) * this.maxLeft / this.valueRange; return Math.round((Math.ceil(val) - this.minValue) * this.maxLeft / this.valueRange);
}, },
/** /**
...@@ -879,7 +882,7 @@ function throttle(func, wait, options) { ...@@ -879,7 +882,7 @@ function throttle(func, wait, options) {
{ {
this.scope[this.tracking] = this.minValue; this.scope[this.tracking] = this.minValue;
this.updateHandles(this.tracking, 0); this.updateHandles(this.tracking, 0);
//this.scope.$apply(); this.scope.$apply();
} }
return; return;
...@@ -891,7 +894,7 @@ function throttle(func, wait, options) { ...@@ -891,7 +894,7 @@ function throttle(func, wait, options) {
{ {
this.scope[this.tracking] = this.maxValue; this.scope[this.tracking] = this.maxValue;
this.updateHandles(this.tracking, this.maxLeft); this.updateHandles(this.tracking, this.maxLeft);
//this.scope.$apply(); this.scope.$apply();
} }
return; return;
......
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