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=84e7e4635300309ee0dec8155d3141db3f842934;p=oweals%2Fluci.git luci-base: ui.js: add LuCI.ui.menu.flushCache() function Signed-off-by: Jo-Philipp Wich (cherry picked from commit 90a51ab3b9afca0144a93eb967fcd72a230732f0) --- diff --git a/modules/luci-base/htdocs/luci-static/resources/ui.js b/modules/luci-base/htdocs/luci-static/resources/ui.js index 67d3497d0..06520f7f8 100644 --- a/modules/luci-base/htdocs/luci-static/resources/ui.js +++ b/modules/luci-base/htdocs/luci-static/resources/ui.js @@ -2996,6 +2996,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