Skip to content

Commit e417c3b

Browse files
committed
Fix #16
1 parent a20704a commit e417c3b

File tree

6 files changed

+12
-117
lines changed

6 files changed

+12
-117
lines changed

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

demo/tabs.html

Lines changed: 0 additions & 108 deletions
This file was deleted.

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

rzslider.js

Lines changed: 7 additions & 4 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.13
7+
* Version: v0.1.14
88
*
99
* Licensed under the MIT license
1010
*/
@@ -575,6 +575,9 @@ function throttle(func, wait, options) {
575575
*/
576576
updateLowHandle: function(newOffset)
577577
{
578+
var delta = Math.abs(this.minH.rzsl - newOffset);
579+
if(delta === 0 || delta === 1) return;
580+
578581
this.setLeft(this.minH, newOffset);
579582
this.translateFn(this.scope.rzSliderModel, this.minLab);
580583
this.setLeft(this.minLab, newOffset - this.minLab.rzsw / 2 + this.handleHalfWidth);
@@ -786,7 +789,7 @@ function throttle(func, wait, options) {
786789
*/
787790
valueToOffset: function(val)
788791
{
789-
return (Math.ceil(val) - this.minValue) * this.maxLeft / this.valueRange;
792+
return Math.round((Math.ceil(val) - this.minValue) * this.maxLeft / this.valueRange);
790793
},
791794

792795
/**
@@ -879,7 +882,7 @@ function throttle(func, wait, options) {
879882
{
880883
this.scope[this.tracking] = this.minValue;
881884
this.updateHandles(this.tracking, 0);
882-
//this.scope.$apply();
885+
this.scope.$apply();
883886
}
884887

885888
return;
@@ -891,7 +894,7 @@ function throttle(func, wait, options) {
891894
{
892895
this.scope[this.tracking] = this.maxValue;
893896
this.updateHandles(this.tracking, this.maxLeft);
894-
//this.scope.$apply();
897+
this.scope.$apply();
895898
}
896899

897900
return;

0 commit comments

Comments
 (0)