This repository was archived by the owner on Oct 6, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -384,6 +384,10 @@ function rowFromTo(d) {
384
384
return [ rowFrom , rowTo ] ;
385
385
}
386
386
387
+ function overlap ( a , b ) {
388
+ return a [ 0 ] < b [ 1 ] && a [ 1 ] > b [ 0 ] ;
389
+ }
390
+
387
391
function makeDragRow ( cellsColumnBlock ) {
388
392
return function dragRow ( d ) {
389
393
var calcdata = d . calcdata ;
@@ -400,6 +404,15 @@ function makeDragRow(cellsColumnBlock) {
400
404
var bottom = firstRowAnchor ( blocks , blocks . length ) ;
401
405
var scrollY = calcdata . scrollY = Math . max ( 0 , Math . min ( bottom - scrollHeight , calcdata . scrollY ) ) ;
402
406
var dAnchor = firstRowAnchor ( blocks , d . page ) ;
407
+ var pages = [ ] ;
408
+ for ( var p = 0 ; p < blocks . length ; p ++ ) {
409
+ var pTop = firstRowAnchor ( blocks , p ) ;
410
+ var pBottom = pTop + rowsHeight ( blocks [ p ] , Infinity ) ;
411
+ if ( overlap ( [ scrollY , scrollY + scrollHeight ] , [ pTop , pBottom ] ) ) {
412
+ pages . push ( p ) ;
413
+ }
414
+ }
415
+ console . log ( 'pages:' , pages ) ;
403
416
if ( d . page < 0 || direction === 'down' && scrollY - dAnchor > rowsHeight ( currentBlock , Infinity ) ) {
404
417
if ( d . page + 2 < blocks . length ) {
405
418
d . page += 2 ;
You can’t perform that action at this time.
0 commit comments