This repository was archived by the owner on Mar 17, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change 43
43
dir = direction . apply ( this , args ) ,
44
44
nodel = d3 . select ( node ) ,
45
45
i = directions . length ,
46
- coords
46
+ coords ,
47
+ scrollTop = document . documentElement . scrollTop || document . body . scrollTop ,
48
+ scrollLeft = document . documentElement . scrollLeft || document . body . scrollLeft
47
49
48
50
nodel . html ( content )
49
51
. style ( { opacity : 1 , 'pointer-events' : 'all' } )
50
52
51
53
while ( i -- ) nodel . classed ( directions [ i ] , false )
52
54
coords = direction_callbacks . get ( dir ) . apply ( this )
53
55
nodel . classed ( dir , true ) . style ( {
54
- top : ( coords . top + poffset [ 0 ] ) + 'px' ,
55
- left : ( coords . left + poffset [ 1 ] ) + 'px'
56
+ top : ( coords . top + poffset [ 0 ] ) + scrollTop + 'px' ,
57
+ left : ( coords . left + poffset [ 1 ] ) + scrollLeft + 'px'
56
58
} )
57
59
58
60
return tip
261
263
width = tbbox . width ,
262
264
height = tbbox . height ,
263
265
x = tbbox . x ,
264
- y = tbbox . y ,
265
- scrollEl = document . documentElement ? document . documentElement : document . body ,
266
- scrollTop = scrollEl . scrollTop ,
267
- scrollLeft = scrollEl . scrollLeft
266
+ y = tbbox . y
268
267
269
-
270
- point . x = x + scrollLeft
271
- point . y = y + scrollTop
268
+ point . x = x
269
+ point . y = y
272
270
bbox . nw = point . matrixTransform ( matrix )
273
271
point . x += width
274
272
bbox . ne = point . matrixTransform ( matrix )
You can’t perform that action at this time.
0 commit comments