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:
parent
5ce7daacda
commit
84e7e46353
1 changed files with 8 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue