mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Vocabulary builder: make a word's book title changeable (#9776)
Adds the ability to re-assign which book a word belongs to and change the name of an existing book. It can be used as a way to regroup words and hide/show them by book.
This commit is contained in:
@@ -84,7 +84,7 @@ function SortItemWidget:init()
|
||||
TextWidget:new{
|
||||
text = self.item.text,
|
||||
max_width = text_max_width,
|
||||
face = self.face,
|
||||
face = self.item.face or self.face,
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -98,7 +98,11 @@ function SortItemWidget:onTap(_, ges)
|
||||
self.item:callback()
|
||||
end
|
||||
elseif self.show_parent.sort_disabled then
|
||||
return true
|
||||
if self.item.callback then
|
||||
self.item:callback()
|
||||
else
|
||||
return true
|
||||
end
|
||||
elseif self.show_parent.marked == self.index then
|
||||
self.show_parent.marked = 0
|
||||
else
|
||||
@@ -109,7 +113,9 @@ function SortItemWidget:onTap(_, ges)
|
||||
end
|
||||
|
||||
function SortItemWidget:onHold()
|
||||
if self.item.callback then
|
||||
if self.item.hold_callback then
|
||||
self.item:hold_callback(function() self.show_parent:_populateItems() end)
|
||||
elseif self.item.callback then
|
||||
self.item:callback()
|
||||
self.show_parent:_populateItems()
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user