This commit is contained in:
Kovid Goyal 2012-06-19 13:59:31 +05:30
parent c6bf118b38
commit 475a41d158
2 changed files with 2 additions and 0 deletions

Binary file not shown.

View File

@ -225,6 +225,8 @@ class PagedDisplay
this.scroll_to_xpos(absleft(elem) + 5)
snap_to_selection: () ->
# Ensure that the viewport is positioned at the start of the column
# containing the start of the current selection
sel = window.getSelection()
r = sel.getRangeAt(0).getBoundingClientRect()
node = sel.anchorNode