Fix: Unhighlight is not clickable in dictionary view and Deleting highlights in bookmarks does not take effect (#3034)

* Fix: Unhighlight is not clickable in dictionary view
* Fix: Deleting highlights in bookmarks does not take effect
This commit is contained in:
Robert
2017-07-28 22:39:54 +02:00
committed by Frans de Jonge
parent c9a997f42c
commit 4d0f66a354
3 changed files with 46 additions and 6 deletions

View File

@@ -213,7 +213,7 @@ function ReaderBookmark:onShowBookmark()
{
text = _("Remove this bookmark"),
callback = function()
bookmark:removeBookmark(item)
bookmark:removeHightligit(item)
bm_menu:switchItemTable(nil, bookmark.bookmarks, -1)
UIManager:close(self.remove_bookmark_dialog)
end,
@@ -315,6 +315,14 @@ function ReaderBookmark:isBookmarkAdded(item)
return false
end
function ReaderBookmark:removeHightligit(item)
if item.pos0 then
self.ui:handleEvent(Event:new("Unhighlight", item))
else
self:removeBookmark(item)
end
end
-- binary search to remove bookmark
function ReaderBookmark:removeBookmark(item)
local _middle