mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Added Swipe to follow nearest link/to jump to latest bookmark (#3207)
This commit is contained in:
@@ -395,4 +395,16 @@ function ReaderBookmark:onGotoNextBookmark(pn_or_xp)
|
||||
return true
|
||||
end
|
||||
|
||||
function ReaderBookmark:getLatestBookmark()
|
||||
local latest_bookmark = nil
|
||||
local latest_bookmark_datetime = "0"
|
||||
for i = 1, #self.bookmarks do
|
||||
if self.bookmarks[i].datetime > latest_bookmark_datetime then
|
||||
latest_bookmark_datetime = self.bookmarks[i].datetime
|
||||
latest_bookmark = self.bookmarks[i]
|
||||
end
|
||||
end
|
||||
return latest_bookmark
|
||||
end
|
||||
|
||||
return ReaderBookmark
|
||||
|
||||
Reference in New Issue
Block a user