Commit 270a1f84 authored by William Neely's avatar William Neely

Updated to work with jqLite/Ionic

Bound touchmove/mousemove to slider instead of document. Used $document.one to remove event on touchend/mouseup
parent 5e669dda
...@@ -784,13 +784,13 @@ function throttle(func, wait, options) { ...@@ -784,13 +784,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.rzslider', angular.bind(this, this.onMove, pointer)); this.sliderElem.on('touchmove', angular.bind(this, this.onMove, pointer));
$document.on('touchend.rzslider', angular.bind(this, this.onEnd)); $document.one('touchend', angular.bind(this, this.onEnd));
} }
else else
{ {
$document.on('mousemove.rzslider', angular.bind(this, this.onMove, pointer)); this.sliderElem.on('mousemove', angular.bind(this, this.onMove, pointer));
$document.on('mouseup.rzslider', angular.bind(this, this.onEnd)); $document.one('mouseup', angular.bind(this, this.onEnd));
} }
}, },
...@@ -876,13 +876,11 @@ function throttle(func, wait, options) { ...@@ -876,13 +876,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.rzslider'); this.sliderElem.off('touchmove');
$document.unbind('touchend.rzslider');
} }
else else
{ {
$document.unbind('mousemove.rzslider'); this.sliderElem.off('mousemove');
$document.unbind('mouseup.rzslider');
} }
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