UI: Clicking menu icon returns to top of menu (#7074)

Fixes: #6940
pull/7088/head
John Beard 4 years ago committed by GitHub
parent fbf60f96e4
commit fca87b5b3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -716,15 +716,16 @@ function TouchMenu:switchMenuTab(tab_num)
if self.tab_item_table[tab_num].callback then if self.tab_item_table[tab_num].callback then
self.tab_item_table[tab_num].callback() self.tab_item_table[tab_num].callback()
end end
if self.cur_tab ~= tab_num then
-- it's like getting a new menu everytime we switch tab! -- It's like getting a new menu everytime we switch tab!
self.page = 1 -- Also, switching to the _same_ tab resets the stack and takes us back to
-- clear item table stack -- the top of the menu tree
self.item_table_stack = {} self.page = 1
self.cur_tab = tab_num -- clear item table stack
self.item_table = self.tab_item_table[tab_num] self.item_table_stack = {}
self:updateItems() self.cur_tab = tab_num
end self.item_table = self.tab_item_table[tab_num]
self:updateItems()
end end
function TouchMenu:backToUpperMenu() function TouchMenu:backToUpperMenu()

Loading…
Cancel
Save