Browse Source

Merge pull request #1266 from noelheesen/master

Extend scrollCustomFn
pull/1274/head
Lebedev Konstantin 7 years ago committed by GitHub
parent
commit
144ad2b84c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      README.md
  2. 4
      Sortable.js
  3. 2
      Sortable.min.js

2
README.md

@ -101,7 +101,7 @@ var sortable = new Sortable(el, {
fallbackTolerance: 0, // Specify in pixels how far the mouse should move before it's considered as a drag. fallbackTolerance: 0, // Specify in pixels how far the mouse should move before it's considered as a drag.
scroll: true, // or HTMLElement scroll: true, // or HTMLElement
scrollFn: function(offsetX, offsetY, originalEvent) { ... }, // if you have custom scrollbar scrollFn may be used for autoscrolling scrollFn: function(offsetX, offsetY, originalEvent, touchEvt, hoverTargetEl) { ... }, // if you have custom scrollbar scrollFn may be used for autoscrolling
scrollSensitivity: 30, // px, how near the mouse must be to an edge to start scrolling. scrollSensitivity: 30, // px, how near the mouse must be to an edge to start scrolling.
scrollSpeed: 10, // px scrollSpeed: 10, // px

4
Sortable.js

@ -167,7 +167,9 @@
scrollOffsetX = vx ? vx * speed : 0; scrollOffsetX = vx ? vx * speed : 0;
if ('function' === typeof(scrollCustomFn)) { if ('function' === typeof(scrollCustomFn)) {
return scrollCustomFn.call(_this, scrollOffsetX, scrollOffsetY, evt); if (scrollCustomFn.call(_this, scrollOffsetX, scrollOffsetY, evt, touchEvt, el) !== 'continue') {
return;
}
} }
if (el === win) { if (el === win) {

2
Sortable.min.js vendored

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save