Commit c6b9e49d authored by Rafal Zajac's avatar Rafal Zajac

Merge branch 'master' of https://github.com/willyboy/angularjs-slider into willyboy-master

parents e417c3b6 991880dc
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* Licensed under the MIT license * Licensed under the MIT license
*/ */
/* global angular: false, window: false */ /* global angular: false */
angular.module('rzModule', []) angular.module('rzModule', [])
...@@ -843,13 +843,13 @@ function throttle(func, wait, options) { ...@@ -843,13 +843,13 @@ function throttle(func, wait, options) {
if(event.touches || (typeof(event.originalEvent) != 'undefined' && event.originalEvent.touches)) if(event.touches || (typeof(event.originalEvent) != 'undefined' && event.originalEvent.touches))
{ {
$document.on('touchmove', angular.bind(this, this.onMove, pointer)); this.sliderElem.on('touchmove', angular.bind(this, this.onMove, pointer));
$document.on('touchend', angular.bind(this, this.onEnd)); $document.one('touchend', angular.bind(this, this.onEnd));
} }
else else
{ {
$document.on('mousemove', angular.bind(this, this.onMove, pointer)); this.sliderElem.on('mousemove', angular.bind(this, this.onMove, pointer));
$document.on('mouseup', angular.bind(this, this.onEnd)); $document.one('mouseup', angular.bind(this, this.onEnd));
} }
}, },
...@@ -944,13 +944,11 @@ function throttle(func, wait, options) { ...@@ -944,13 +944,11 @@ function throttle(func, wait, options) {
if(event.touches || (typeof(event.originalEvent) != 'undefined' && event.originalEvent.touches)) if(event.touches || (typeof(event.originalEvent) != 'undefined' && event.originalEvent.touches))
{ {
$document.unbind('touchmove'); this.sliderElem.off('touchmove');
$document.unbind('touchend');
} }
else else
{ {
$document.unbind('mousemove'); this.sliderElem.off('mousemove');
$document.unbind('mouseup');
} }
this.scope.$emit('slideEnded'); this.scope.$emit('slideEnded');
......
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