mirror of
https://github.com/MikaylaFischler/cc-mek-scada.git
synced 2024-08-30 18:22:34 +00:00
#403 nav up button sends back to prior app if open_help was used
This commit is contained in:
parent
356caf7b4d
commit
95b93eb795
@ -65,6 +65,7 @@ function iocontrol.alloc_nav()
|
|||||||
apps = {},
|
apps = {},
|
||||||
containers = {},
|
containers = {},
|
||||||
help_map = {},
|
help_map = {},
|
||||||
|
help_return = nil,
|
||||||
cur_app = APP_ID.ROOT
|
cur_app = APP_ID.ROOT
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -185,6 +186,9 @@ function iocontrol.alloc_nav()
|
|||||||
-- open a given app
|
-- open a given app
|
||||||
---@param app_id POCKET_APP_ID
|
---@param app_id POCKET_APP_ID
|
||||||
function io.nav.open_app(app_id)
|
function io.nav.open_app(app_id)
|
||||||
|
-- reset help return on navigating out of an app
|
||||||
|
if app_id == APP_ID.ROOT then self.help_return = nil end
|
||||||
|
|
||||||
local app = self.apps[app_id] ---@type pocket_app
|
local app = self.apps[app_id] ---@type pocket_app
|
||||||
if app then
|
if app then
|
||||||
if not app.loaded then app.load() end
|
if not app.loaded then app.load() end
|
||||||
@ -211,6 +215,13 @@ function iocontrol.alloc_nav()
|
|||||||
|
|
||||||
-- attempt to navigate up
|
-- attempt to navigate up
|
||||||
function io.nav.nav_up()
|
function io.nav.nav_up()
|
||||||
|
-- return out of help if opened with open_help
|
||||||
|
if self.help_return then
|
||||||
|
io.nav.open_app(self.help_return)
|
||||||
|
self.help_return = nil
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
local app = self.apps[self.cur_app] ---@type pocket_app
|
local app = self.apps[self.cur_app] ---@type pocket_app
|
||||||
log.debug("attempting app nav up for app " .. self.cur_app)
|
log.debug("attempting app nav up for app " .. self.cur_app)
|
||||||
|
|
||||||
@ -220,7 +231,10 @@ function iocontrol.alloc_nav()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- open the help app, to show the reference for a key
|
||||||
function io.nav.open_help(key)
|
function io.nav.open_help(key)
|
||||||
|
self.help_return = self.cur_app
|
||||||
|
|
||||||
io.nav.open_app(APP_ID.GUIDE)
|
io.nav.open_app(APP_ID.GUIDE)
|
||||||
|
|
||||||
local load = self.help_map[key]
|
local load = self.help_map[key]
|
||||||
|
Loading…
Reference in New Issue
Block a user