Confirmed users
764
edits
m (→function) |
|||
| 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 | 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: | ||