Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions jquery.mCustomScrollbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,12 @@ and dependencies (minified).
releaseDraggableSelectors null
*/
/*
callback used to disable touch event (parameters will be event and coordinates)
option default
-------------------------------------
disableTouch null
*/
/*
auto-update timeout
values: integer (milliseconds)
*/
Expand Down Expand Up @@ -1291,8 +1297,11 @@ and dependencies (minified).
});
});
}
function isTouchDisabled(e) {
return o.advanced.disableTouch ? o.advanced.disableTouch(e, _coordinates(e)) : false;
}
function _onTouchstart(e){
if(!_pointerTouch(e) || touchActive || _coordinates(e)[2]){touchable=0; return;}
if(!_pointerTouch(e) || touchActive || _coordinates(e)[2] || isTouchDisabled(e)){touchable=0; return;}
touchable=1; touchDrag=0; docDrag=0; draggable=1;
$this.removeClass("mCS_touch_action");
var offset=mCSB_container.offset();
Expand All @@ -1301,7 +1310,7 @@ and dependencies (minified).
touchIntent=[_coordinates(e)[0],_coordinates(e)[1]];
}
function _onTouchmove(e){
if(!_pointerTouch(e) || touchActive || _coordinates(e)[2]){return;}
if(!_pointerTouch(e) || touchActive || _coordinates(e)[2] || isTouchDisabled(e)){return;}
if(!o.documentTouchScroll){e.preventDefault();}
e.stopImmediatePropagation();
if(docDrag && !touchDrag){return;}
Expand Down Expand Up @@ -1335,7 +1344,7 @@ and dependencies (minified).
}
}
function _onTouchstart2(e){
if(!_pointerTouch(e) || touchActive || _coordinates(e)[2]){touchable=0; return;}
if(!_pointerTouch(e) || touchActive || _coordinates(e)[2] || isTouchDisabled(e)){touchable=0; return;}
touchable=1;
e.stopImmediatePropagation();
_stop($this);
Expand All @@ -1346,7 +1355,7 @@ and dependencies (minified).
touchMoveY=[]; touchMoveX=[];
}
function _onTouchend(e){
if(!_pointerTouch(e) || touchActive || _coordinates(e)[2]){return;}
if(!_pointerTouch(e) || touchActive || _coordinates(e)[2] || isTouchDisabled(e)){return;}
draggable=0;
e.stopImmediatePropagation();
touchDrag=0; docDrag=0;
Expand Down Expand Up @@ -2422,4 +2431,4 @@ and dependencies (minified).

});

}))}));
}))}));