Dispatcher: add addCurrentLocationToStack

This is useful when i want to reference something a few pages away while keeping track of my current page
This commit is contained in:
yparitcher
2023-05-04 19:00:28 -04:00
committed by Frans de Jonge
parent 2aeb4a87df
commit de5c872dcb
2 changed files with 9 additions and 0 deletions

View File

@@ -702,6 +702,13 @@ function ReaderLink:compareLocationToCurrent(saved_location)
return false, current_location
end
function ReaderLink:onAddCurrentLocationToStack(show_notification)
self:addCurrentLocationToStack()
if show_notification then
Notification:notify(_("Current location added to history."))
end
end
-- Remember current location so we can go back to it
function ReaderLink:addCurrentLocationToStack(loc)
local location = loc and loc or self:getCurrentLocation()