From 90a51ab3b9afca0144a93eb967fcd72a230732f0 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Thu, 16 Apr 2020 15:13:26 +0200 Subject: [PATCH] luci-base: ui.js: add LuCI.ui.menu.flushCache() function Signed-off-by: Jo-Philipp Wich --- modules/luci-base/htdocs/luci-static/resources/ui.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/luci-base/htdocs/luci-static/resources/ui.js b/modules/luci-base/htdocs/luci-static/resources/ui.js index 57f8e2bff4..6d77f37824 100644 --- a/modules/luci-base/htdocs/luci-static/resources/ui.js +++ b/modules/luci-base/htdocs/luci-static/resources/ui.js @@ -2989,6 +2989,14 @@ var UIMenu = baseclass.singleton(/** @lends LuCI.ui.menu.prototype */ { return Promise.resolve(this.menu); }, + /** + * Flush the internal menu cache to force loading a new structure on the + * next page load. + */ + flushCache: function() { + session.setLocalData('menu', null); + }, + /** * @param {LuCI.ui.menu.MenuNode} [node] * The menu node to retrieve the children for. Defaults to the menu's -- 2.30.2