[fix] "Follow Link" popup issues (#3198)

* Add current location to location stack from follow link popup
  See https://github.com/koreader/koreader/pull/3190#issuecomment-328332771
* Word highlight not removed
* "Follow Link" not translated
* Typo in docs
pull/3199/head
Frans de Jonge 7 years ago committed by GitHub
parent 392209c200
commit 7310937219

@ -3,7 +3,6 @@ local ConfirmBox = require("ui/widget/confirmbox")
local Device = require("device")
local Event = require("ui/event")
local InputContainer = require("ui/widget/container/inputcontainer")
local ReaderLink = require("apps/reader/modules/readerlink")
local UIManager = require("ui/uimanager")
local logger = require("logger")
local _ = require("gettext")
@ -251,9 +250,7 @@ function ReaderHighlight:onHold(arg, ges)
if ok and word then
logger.dbg("selected word:", word)
self.selected_word = word
ReaderLink.ui = self.ui
ReaderLink.view = self.view
local link = ReaderLink:getLinkFromGes(ges)
local link = self.ui.link:getLinkFromGes(ges)
self.selected_link = nil
if link then
logger.dbg("link:", link)
@ -392,7 +389,7 @@ function ReaderHighlight:onHoldRelease()
text = _("Follow Link"),
enabled = self.selected_link ~= nil,
callback = function()
ReaderLink:onGotoLink(self.selected_link)
self.ui.link:onGotoLink(self.selected_link)
UIManager:close(self.highlight_dialog)
end,
},

@ -1,6 +1,6 @@
--[[
--[[--
ReaderLink is an abstraction for document-specific link interfaces.
]]--
]]
local Device = require("device")
local Event = require("ui/event")

@ -14,7 +14,6 @@ local InputDialog = require("ui/widget/inputdialog")
local LeftContainer = require("ui/widget/container/leftcontainer")
local LineWidget = require("ui/widget/linewidget")
local OverlapGroup = require("ui/widget/overlapgroup")
local ReaderLink = require("apps/reader/modules/readerlink")
local ScrollTextWidget = require("ui/widget/scrolltextwidget")
local TextWidget = require("ui/widget/textwidget")
local UIManager = require("ui/uimanager")
@ -368,7 +367,7 @@ function DictQuickLookup:update()
{
-- if more than one language, enable it and display "current lang > next lang"
-- otherwise, just display current lang
text = self.is_wiki and ( #self.wiki_languages > 1 and self.wiki_languages[1].." > "..self.wiki_languages[2] or self.wiki_languages[1] ) or "Follow Link",
text = self.is_wiki and ( #self.wiki_languages > 1 and self.wiki_languages[1].." > "..self.wiki_languages[2] or self.wiki_languages[1] ) or _("Follow Link"),
enabled = (self.is_wiki and #self.wiki_languages > 1) or self.selected_link ~= nil,
callback = function()
if self.is_wiki then
@ -376,8 +375,8 @@ function DictQuickLookup:update()
UIManager:close(self)
self:lookupWikipedia()
else
UIManager:close(self)
ReaderLink:onGotoLink(self.selected_link)
self:onClose()
self.ui.link:onGotoLink(self.selected_link)
end
end,
},

Loading…
Cancel
Save