[UX] Next/Previous Bookmark Gestures (#5968)

Fixes #5965
This commit is contained in:
yparitcher
2020-03-16 11:52:09 -04:00
committed by GitHub
parent 4a5a2eb708
commit 08359ee1b6
6 changed files with 39 additions and 55 deletions

View File

@@ -209,8 +209,10 @@ function ReaderBookmark:onPosUpdate(pos)
end
function ReaderBookmark:gotoBookmark(pn_or_xp)
local event = self.ui.document.info.has_pages and "GotoPage" or "GotoXPointer"
self.ui:handleEvent(Event:new(event, pn_or_xp))
if pn_or_xp then
local event = self.ui.document.info.has_pages and "GotoPage" or "GotoXPointer"
self.ui:handleEvent(Event:new(event, pn_or_xp))
end
end
function ReaderBookmark:onShowBookmark()
@@ -607,6 +609,16 @@ function ReaderBookmark:onGotoNextBookmark(pn_or_xp)
return true
end
function ReaderBookmark:onGotoNextBookmarkFromPage()
self:gotoBookmark(self:getNextBookmarkedPageFromPage(self.ui:getCurrentPage()))
return true
end
function ReaderBookmark:onGotoPreviousBookmarkFromPage()
self:gotoBookmark(self:getPreviousBookmarkedPageFromPage(self.ui:getCurrentPage()))
return true
end
function ReaderBookmark:getLatestBookmark()
local latest_bookmark = nil
local latest_bookmark_datetime = "0"