From 89a14f4158ed09ce87f3ff6dc02df56735cda49c Mon Sep 17 00:00:00 2001 From: hius07 <62179190+hius07@users.noreply.github.com> Date: Sat, 31 May 2025 11:21:46 +0300 Subject: [PATCH] filemanagercollection: fix manual sorting (#13898) Closes #13843. --- .../apps/filemanager/filemanagercollection.lua | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/frontend/apps/filemanager/filemanagercollection.lua b/frontend/apps/filemanager/filemanagercollection.lua index 2b3bf31ec..7072578d2 100644 --- a/frontend/apps/filemanager/filemanagercollection.lua +++ b/frontend/apps/filemanager/filemanagercollection.lua @@ -743,16 +743,18 @@ function FileManagerCollection:showArrangeBooksDialog() text = _("Manual sorting") .. (curr_collate_id == nil and " ✓" or ""), callback = function() UIManager:close(arrange_dialog) - UIManager:show(SortWidget:new{ + local sort_widget + sort_widget = SortWidget:new{ title = _("Arrange books in collection"), item_table = self.booklist_menu.item_table, callback = function() - ReadCollection:updateCollectionOrder(collection_name, self.booklist_menu.item_table) + ReadCollection:updateCollectionOrder(collection_name, sort_widget.item_table) self.updated_collections[collection_name] = true self:setCollate(false, false) self:updateItemTable() end, - }) + } + UIManager:show(sort_widget) end, }}, } @@ -1292,15 +1294,17 @@ function FileManagerCollection:removeCollection(item) end function FileManagerCollection:sortCollections() - UIManager:show(SortWidget:new{ + local sort_widget + sort_widget = SortWidget:new{ title = _("Arrange collections"), item_table = self.coll_list.item_table, callback = function() self.updated_collections = { true } -- all - ReadCollection:updateCollectionListOrder(self.coll_list.item_table) + ReadCollection:updateCollectionListOrder(sort_widget.item_table) self:updateCollListItemTable(true) -- init end, - }) + } + UIManager:show(sort_widget) end function FileManagerCollection:onShowCollectionsSearchDialog(search_str, coll_name)