Skip to content

Commit

Permalink
Take page offset into account when placing cursor
Browse files Browse the repository at this point in the history
Fixes #194
  • Loading branch information
jhchen committed Aug 11, 2014
1 parent 3119f78 commit 9bf2e64
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/modules/multi-cursor.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,9 @@ class MultiCursor extends EventEmitter2
return cursor

_moveCursor: (cursor, reference, side = 'left') ->
win = dom(reference).window()
bounds = reference.getBoundingClientRect()
cursor.elem.style.top = bounds.top + 'px'
cursor.elem.style.top = bounds.top + win.pageYOffset + 'px'
cursor.elem.style.left = bounds[side] + 'px'
cursor.elem.style.height = bounds.height + 'px'
flag = cursor.elem.querySelector('.cursor-flag')
Expand Down

0 comments on commit 9bf2e64

Please sign in to comment.