Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Double-tap chapter nav: add origin page to location stack #4339

Merged
merged 1 commit into from Nov 16, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 10 additions & 2 deletions frontend/apps/reader/modules/readerrolling.lua
Expand Up @@ -407,13 +407,21 @@ end
function ReaderRolling:onDoubleTapForward()
local visible_page_count = self.ui.document:getVisiblePageCount()
local pageno = self.current_page + (visible_page_count > 1 and 1 or 0)
self:onGotoPage(self.ui.toc:getNextChapter(pageno, 0))
local new_page = self.ui.toc:getNextChapter(pageno, 0)
if new_page then
self.ui.link:addCurrentLocationToStack()
self:onGotoPage(new_page)
end
return true
end

function ReaderRolling:onDoubleTapBackward()
local pageno = self.current_page
self:onGotoPage(self.ui.toc:getPreviousChapter(pageno, 0))
local new_page = self.ui.toc:getPreviousChapter(pageno, 0)
if new_page then
self.ui.link:addCurrentLocationToStack()
self:onGotoPage(new_page)
end
return true
end

Expand Down