Skip to content

Commit 16d40d9

Browse files
committed
Merge branch 'willyboy-master'
2 parents e417c3b + c6b9e49 commit 16d40d9

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

rzslider.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Licensed under the MIT license
1010
*/
1111

12-
/* global angular: false, window: false */
12+
/* global angular: false */
1313

1414
angular.module('rzModule', [])
1515

@@ -843,13 +843,13 @@ function throttle(func, wait, options) {
843843

844844
if(event.touches || (typeof(event.originalEvent) != 'undefined' && event.originalEvent.touches))
845845
{
846-
$document.on('touchmove', angular.bind(this, this.onMove, pointer));
847-
$document.on('touchend', angular.bind(this, this.onEnd));
846+
this.sliderElem.on('touchmove', angular.bind(this, this.onMove, pointer));
847+
$document.one('touchend', angular.bind(this, this.onEnd));
848848
}
849849
else
850850
{
851-
$document.on('mousemove', angular.bind(this, this.onMove, pointer));
852-
$document.on('mouseup', angular.bind(this, this.onEnd));
851+
this.sliderElem.on('mousemove', angular.bind(this, this.onMove, pointer));
852+
$document.one('mouseup', angular.bind(this, this.onEnd));
853853
}
854854
},
855855

@@ -944,13 +944,11 @@ function throttle(func, wait, options) {
944944

945945
if(event.touches || (typeof(event.originalEvent) != 'undefined' && event.originalEvent.touches))
946946
{
947-
$document.unbind('touchmove');
948-
$document.unbind('touchend');
947+
this.sliderElem.off('touchmove');
949948
}
950949
else
951950
{
952-
$document.unbind('mousemove');
953-
$document.unbind('mouseup');
951+
this.sliderElem.off('mousemove');
954952
}
955953

956954
this.scope.$emit('slideEnded');

0 commit comments

Comments
 (0)