diff --git a/resources/compiled_coffeescript.zip b/resources/compiled_coffeescript.zip index ceef59650d..bb4bee87f8 100644 Binary files a/resources/compiled_coffeescript.zip and b/resources/compiled_coffeescript.zip differ diff --git a/src/calibre/ebooks/oeb/display/paged.coffee b/src/calibre/ebooks/oeb/display/paged.coffee index 8fa1caf8ea..5fb8346540 100644 --- a/src/calibre/ebooks/oeb/display/paged.coffee +++ b/src/calibre/ebooks/oeb/display/paged.coffee @@ -227,11 +227,12 @@ class PagedDisplay 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 - left = viewport_to_document(r.left, r.top, doc=node.ownerDocument)[0] if this.in_paged_mode + sel = window.getSelection() + r = sel.getRangeAt(0).getBoundingClientRect() + node = sel.anchorNode + left = viewport_to_document(r.left, r.top, doc=node.ownerDocument)[0] + # Ensure we are scrolled to the column containing the start of the # selection this.scroll_to_xpos(left+5)