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

Fixes #5965
This commit is contained in:
yparitcher authored and GitHub committed 2020-03-16 16:52:09 +01:00
1 parent 4a5a2eb708
commit 08359ee1b6
6 files changed
+39 -55

No files matched your search

@@ -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"