Skip to content

Commit

Permalink
Added fix for issue malihu#303 (malihu#303) regarding mobile Google C…
Browse files Browse the repository at this point in the history
…hrome
  • Loading branch information
malihu committed Jun 8, 2015
1 parent 1fc3b66 commit 2cbe6a9
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 10 deletions.
5 changes: 2 additions & 3 deletions jquery.mCustomScrollbar.concat.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion jquery.mCustomScrollbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ CONTENTS:
*/

.mCustomScrollbar{ -ms-touch-action: none; touch-action: none; /* MSPointer events - direct all pointer events to js */ }
.mCustomScrollbar.mCS_no_scrollbar{ -ms-touch-action: auto; touch-action: auto; }
.mCustomScrollbar.mCS_no_scrollbar, .mCustomScrollbar.mCS_touch_action{ -ms-touch-action: auto; touch-action: auto; }

.mCustomScrollBox{ /* contains plugin's markup */
position: relative;
Expand Down
9 changes: 8 additions & 1 deletion jquery.mCustomScrollbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1271,6 +1271,7 @@ and dependencies (minified).
function _onTouchstart(e){
if(!_pointerTouch(e) || touchActive || _coordinates(e)[2]){touchable=0; return;}
touchable=1; touchDrag=0; docDrag=0;
$this.removeClass("mCS_touch_action");
var offset=mCSB_container.offset();
dragY=_coordinates(e)[0]-offset.top;
dragX=_coordinates(e)[1]-offset.left;
Expand All @@ -1294,7 +1295,13 @@ and dependencies (minified).
var limitX=mCSB_dragger[1].parent().width()-mCSB_dragger[1].width(),
preventX=((dragX-x)>0 && (x-dragX)>-(limitX*d.scrollRatio.x) && (touchIntent[2]*2<touchIntent[3] || o.axis==="yx"));
}
if(prevent || preventX){e.preventDefault(); touchDrag=1;}else{docDrag=1;} /* prevent native document scrolling */
if(prevent || preventX){ /* prevent native document scrolling */
e.preventDefault();
touchDrag=1;
}else{
docDrag=1;
$this.addClass("mCS_touch_action");
}
amount=o.axis==="yx" ? [(dragY-y),(dragX-x)] : o.axis==="x" ? [null,(dragX-x)] : [(dragY-y),null];
mCSB_container[0].idleTimer=250;
if(d.overflowed[0]){_drag(amount[0],durA,easing,"y","all",true);}
Expand Down
2 changes: 1 addition & 1 deletion jquery.mCustomScrollbar.min.css

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions 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.
9 changes: 8 additions & 1 deletion js/uncompressed/jquery.mCustomScrollbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1271,6 +1271,7 @@ and dependencies (minified).
function _onTouchstart(e){
if(!_pointerTouch(e) || touchActive || _coordinates(e)[2]){touchable=0; return;}
touchable=1; touchDrag=0; docDrag=0;
$this.removeClass("mCS_touch_action");
var offset=mCSB_container.offset();
dragY=_coordinates(e)[0]-offset.top;
dragX=_coordinates(e)[1]-offset.left;
Expand All @@ -1294,7 +1295,13 @@ and dependencies (minified).
var limitX=mCSB_dragger[1].parent().width()-mCSB_dragger[1].width(),
preventX=((dragX-x)>0 && (x-dragX)>-(limitX*d.scrollRatio.x) && (touchIntent[2]*2<touchIntent[3] || o.axis==="yx"));
}
if(prevent || preventX){e.preventDefault(); touchDrag=1;}else{docDrag=1;} /* prevent native document scrolling */
if(prevent || preventX){ /* prevent native document scrolling */
e.preventDefault();
touchDrag=1;
}else{
docDrag=1;
$this.addClass("mCS_touch_action");
}
amount=o.axis==="yx" ? [(dragY-y),(dragX-x)] : o.axis==="x" ? [null,(dragX-x)] : [(dragY-y),null];
mCSB_container[0].idleTimer=250;
if(d.overflowed[0]){_drag(amount[0],durA,easing,"y","all",true);}
Expand Down

0 comments on commit 2cbe6a9

Please sign in to comment.