dictquicklookup(fix): use self.region for matching hold event

This commit is contained in:
Qingping Hou
2016-06-05 00:08:23 -07:00
parent cc425287da
commit adf5ffdd26
2 changed files with 31 additions and 3 deletions

View File

@@ -81,12 +81,14 @@ function DictQuickLookup:init()
HoldWord = {
GestureRange:new{
ges = "hold",
range = function() return self.dimen end,
range = function()
return self.region
end,
},
-- callback function when HoldWord is handled as args
args = function(word)
self.ui:handleEvent(Event:new("LookupWord",
word, self.word_box))
self.ui:handleEvent(
Event:new("LookupWord", word, self.word_box))
end
},
}
@@ -293,6 +295,7 @@ function DictQuickLookup:onShow()
end
function DictQuickLookup:getHighlightedItem()
if not self.ui then return end
return self.ui.highlight:getHighlightBookmarkItem()
end