@@ -784,13 +784,13 @@ function throttle(func, wait, options) {
784
784
785
785
if ( event . touches || ( typeof ( event . originalEvent ) != 'undefined' && event . originalEvent . touches ) )
786
786
{
787
- $document . on ( 'touchmove.rzslider ' , angular . bind ( this , this . onMove , pointer ) ) ;
788
- $document . on ( 'touchend.rzslider ' , angular . bind ( this , this . onEnd ) ) ;
787
+ this . sliderElem . on ( 'touchmove' , angular . bind ( this , this . onMove , pointer ) ) ;
788
+ $document . one ( 'touchend' , angular . bind ( this , this . onEnd ) ) ;
789
789
}
790
790
else
791
791
{
792
- $document . on ( 'mousemove.rzslider ' , angular . bind ( this , this . onMove , pointer ) ) ;
793
- $document . on ( 'mouseup.rzslider ' , angular . bind ( this , this . onEnd ) ) ;
792
+ this . sliderElem . on ( 'mousemove' , angular . bind ( this , this . onMove , pointer ) ) ;
793
+ $document . one ( 'mouseup' , angular . bind ( this , this . onEnd ) ) ;
794
794
}
795
795
} ,
796
796
@@ -876,13 +876,11 @@ function throttle(func, wait, options) {
876
876
877
877
if ( event . touches || ( typeof ( event . originalEvent ) != 'undefined' && event . originalEvent . touches ) )
878
878
{
879
- $document . unbind ( 'touchmove.rzslider' ) ;
880
- $document . unbind ( 'touchend.rzslider' ) ;
879
+ this . sliderElem . off ( 'touchmove' ) ;
881
880
}
882
881
else
883
882
{
884
- $document . unbind ( 'mousemove.rzslider' ) ;
885
- $document . unbind ( 'mouseup.rzslider' ) ;
883
+ this . sliderElem . off ( 'mousemove' ) ;
886
884
}
887
885
888
886
this . scope . $emit ( 'slideEnded' ) ;
0 commit comments