E-book viewer: Fix clicking entries in TOC that point to the currently loaded document not scrolling view to the top of the document

This commit is contained in:
Kovid Goyal 2010-11-07 11:54:25 -07:00
parent e13ef02c61
commit 06004fca56

View File

@ -472,8 +472,12 @@ class EbookViewer(MainWindow, Ui_EbookViewer):
if path != self.current_page:
self.pending_anchor = frag
self.load_path(path)
elif frag:
self.view.scroll_to(frag)
else:
if frag:
self.view.scroll_to(frag)
else:
# Scroll to top
self.view.scroll_to('#')
else:
open_url(url)