Skip to content

Commit

Permalink
Fixed minor conflict with dragger rail click and snapAmount option, f…
Browse files Browse the repository at this point in the history
…ixed a bug with horizontal scrollbar dragging.
  • Loading branch information
malihu committed Oct 9, 2015
1 parent 0c4fc31 commit 6418a5f
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 9 deletions.
4 changes: 2 additions & 2 deletions jquery.mCustomScrollbar.concat.min.js

Large diffs are not rendered by default.

10 changes: 7 additions & 3 deletions jquery.mCustomScrollbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1203,7 +1203,7 @@ and dependencies (minified).
$(document).bind("mousemove."+namespace+" pointermove."+namespace+" MSPointerMove."+namespace,function(e){
if(draggable){
var offset=draggable.offset(),y=_coordinates(e)[0]-offset.top,x=_coordinates(e)[1]-offset.left;
if(dragY===y){return;} /* has it really moved? */
if(dragY===y && dragX===x){return;} /* has it really moved? */
_drag(dragY,dragX,y,x);
}
}).add(rds).bind("mouseup."+namespace+" touchend."+namespace+" pointerup."+namespace+" MSPointerUp."+namespace,function(e){
Expand Down Expand Up @@ -1528,12 +1528,16 @@ and dependencies (minified).
namespace=pluginPfx+"_"+d.idx,
mCSB_container=$("#mCSB_"+d.idx+"_container"),
wrapper=mCSB_container.parent(),
mCSB_draggerContainer=$(".mCSB_"+d.idx+"_scrollbar ."+classes[12]);
mCSB_draggerContainer.bind("touchstart."+namespace+" pointerdown."+namespace+" MSPointerDown."+namespace,function(e){
mCSB_draggerContainer=$(".mCSB_"+d.idx+"_scrollbar ."+classes[12]),
clickable;
mCSB_draggerContainer.bind("mousedown."+namespace+" touchstart."+namespace+" pointerdown."+namespace+" MSPointerDown."+namespace,function(e){
touchActive=true;
if(!$(e.target).hasClass("mCSB_dragger")){clickable=1;}
}).bind("touchend."+namespace+" pointerup."+namespace+" MSPointerUp."+namespace,function(e){
touchActive=false;
}).bind("click."+namespace,function(e){
if(!clickable){return;}
clickable=0;
if($(e.target).hasClass(classes[12]) || $(e.target).hasClass("mCSB_draggerRail")){
_stop($this);
var el=$(this),mCSB_dragger=el.find(".mCSB_dragger");
Expand Down
2 changes: 1 addition & 1 deletion js/minified/jquery.mCustomScrollbar.min.js

Large diffs are not rendered by default.

Binary file modified js/minified/jquery.mCustomScrollbar.min.js.gz
Binary file not shown.
10 changes: 7 additions & 3 deletions js/uncompressed/jquery.mCustomScrollbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1203,7 +1203,7 @@ and dependencies (minified).
$(document).bind("mousemove."+namespace+" pointermove."+namespace+" MSPointerMove."+namespace,function(e){
if(draggable){
var offset=draggable.offset(),y=_coordinates(e)[0]-offset.top,x=_coordinates(e)[1]-offset.left;
if(dragY===y){return;} /* has it really moved? */
if(dragY===y && dragX===x){return;} /* has it really moved? */
_drag(dragY,dragX,y,x);
}
}).add(rds).bind("mouseup."+namespace+" touchend."+namespace+" pointerup."+namespace+" MSPointerUp."+namespace,function(e){
Expand Down Expand Up @@ -1528,12 +1528,16 @@ and dependencies (minified).
namespace=pluginPfx+"_"+d.idx,
mCSB_container=$("#mCSB_"+d.idx+"_container"),
wrapper=mCSB_container.parent(),
mCSB_draggerContainer=$(".mCSB_"+d.idx+"_scrollbar ."+classes[12]);
mCSB_draggerContainer.bind("touchstart."+namespace+" pointerdown."+namespace+" MSPointerDown."+namespace,function(e){
mCSB_draggerContainer=$(".mCSB_"+d.idx+"_scrollbar ."+classes[12]),
clickable;
mCSB_draggerContainer.bind("mousedown."+namespace+" touchstart."+namespace+" pointerdown."+namespace+" MSPointerDown."+namespace,function(e){
touchActive=true;
if(!$(e.target).hasClass("mCSB_dragger")){clickable=1;}
}).bind("touchend."+namespace+" pointerup."+namespace+" MSPointerUp."+namespace,function(e){
touchActive=false;
}).bind("click."+namespace,function(e){
if(!clickable){return;}
clickable=0;
if($(e.target).hasClass(classes[12]) || $(e.target).hasClass("mCSB_draggerRail")){
_stop($this);
var el=$(this),mCSB_dragger=el.find(".mCSB_dragger");
Expand Down

0 comments on commit 6418a5f

Please sign in to comment.