From: Jo-Philipp Wich Date: Thu, 16 Apr 2020 13:13:26 +0000 (+0200) Subject: luci-base: ui.js: add LuCI.ui.menu.flushCache() function X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=90a51ab3b9afca0144a93eb967fcd72a230732f0;p=oweals%2Fluci.git luci-base: ui.js: add LuCI.ui.menu.flushCache() function Signed-off-by: Jo-Philipp Wich --- diff --git a/modules/luci-base/htdocs/luci-static/resources/ui.js b/modules/luci-base/htdocs/luci-static/resources/ui.js index 57f8e2bff..6d77f3782 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