From 59b0d9e47c21fce2b57c4ce4ebfaf12fa865a961 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 19 Jun 2012 14:00:48 +0530 Subject: [PATCH] ... --- resources/compiled_coffeescript.zip | Bin 36843 -> 36851 bytes src/calibre/ebooks/oeb/display/paged.coffee | 9 +++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/resources/compiled_coffeescript.zip b/resources/compiled_coffeescript.zip index ceef59650df3e1057772eefde3baa9bfd62e6ff8..bb4bee87f8d00a3ac20dc11d0a8f46da478f734a 100644 GIT binary patch delta 101 zcmaDopXu{_Ch-7oW)=|!5D+N1?C|EO=7V)g3=HcwigPPYex|52SxHfOva_Q3rAIluDB31V^+z$@pIqAS&3I|@!G0aKpM4;s0eQ?M+5i9m 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)