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

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
Jo-Philipp Wich 2020-04-16 15:13:26 +02:00
parent 3f1d6870ff
commit 90a51ab3b9

View file

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