luci-base: ui.js: add LuCI.ui.menu.flushCache() function

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 90a51ab3b9)
This commit is contained in:
Jo-Philipp Wich 2020-04-16 15:13:26 +02:00
parent 5ce7daacda
commit 84e7e46353

View file

@ -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