Update search bar after browsing.

develop
Warmist 2015-02-01 20:07:28 +02:00
parent 570381f059
commit c56d928dae
1 changed files with 5 additions and 2 deletions

@ -340,15 +340,17 @@ function GmEditorUi:pushTarget(target_to_push)
new_tbl.target=target_to_push new_tbl.target=target_to_push
new_tbl.keys={} new_tbl.keys={}
new_tbl.selected=1 new_tbl.selected=1
new_tbl.filter=""
if self:currentTarget()~=nil then if self:currentTarget()~=nil then
self:currentTarget().selected=self.subviews.list_main:getSelected() self:currentTarget().selected=self.subviews.list_main:getSelected()
self.stack[#self.stack].filter=self.subviews.filter_input.text
end end
for k,v in pairs(target_to_push) do for k,v in pairs(target_to_push) do
table.insert(new_tbl.keys,k) table.insert(new_tbl.keys,k)
end end
new_tbl.item_count=#new_tbl.keys new_tbl.item_count=#new_tbl.keys
table.insert(self.stack,new_tbl) table.insert(self.stack,new_tbl)
self.subviews.filter_input.text=""
self:updateTarget() self:updateTarget()
end end
function GmEditorUi:popTarget() function GmEditorUi:popTarget()
@ -357,6 +359,7 @@ function GmEditorUi:popTarget()
self:dismiss() self:dismiss()
return return
end end
self.subviews.filter_input.text=self.stack[#self.stack].filter --restore filter
self:updateTarget() self:updateTarget()
end end
function show_editor(trg) function show_editor(trg)