Labs/Jetpack/JEP/14: Difference between revisions

Jump to navigation Jump to search
m
(Undo revision 179223 by Adw (Talk))
Line 208: Line 208:
A menuitem that will update itself when its menu is shown.
A menuitem that will update itself when its menu is shown.


The function is invoked just before the item's menu is shown and before the <code>items</code> array of the item's menu is retrieved.  It must return a non-function menuitem.  If the item belongs to a context menu, the function is called as <code>function(context)</code> and otherwise <code>function()</code>.  <code>context</code> is an [[#Context Objects|object describing the context]] in which the menu was shown.
The function is invoked just before the item's menu is shown and when the <code>items</code> array of the item's menu is retrieved.  It must return a non-function menuitem.  If the item belongs to a context menu, the function is called as <code>function(context)</code> and otherwise <code>function()</code>.  <code>context</code> is an [[#Context Objects|object describing the context]] in which the menu was shown.


Example:
Example:
Confirmed users
764

edits

Navigation menu