Labs/Jetpack/Reboot/JEP/112: Difference between revisions

Jump to navigation Jump to search
m
Line 56: Line 56:
; menuitem : The menuitem to add.  See [[#Specifying New Menuitems]].
; menuitem : The menuitem to add.  See [[#Specifying New Menuitems]].


==== replace(context, target, menuitem) ====
==== insertBefore(context, target, menuitem) ====


Replaces an existing item in the context menu.  If the target item does not exist, this function silently fails, and the context menu is not modified.
Inserts a new item before an existing one.  If the target item does not exist, this function silently fails, and the context menu not modified.


; context : A value describing the context under which to add the item.  See [[#Specifying Contexts]].
; context : A value describing the context under which to add the item.  See [[#Specifying Contexts]].
; target : A value describing the existing item to replace.  See [[#Specifying Existing Menuitems]].
; target : A value describing the existing item before which to insert the new item.  See [[#Specifying Existing Menuitems]].
; menuitem : The menuitem to add.  See [[#Specifying New Menuitems]].
; menuitem : The menuitem to add.  See [[#Specifying New Menuitems]].


==== insertBefore(context, target, menuitem) ====
==== replace(context, target, menuitem) ====


Inserts a new item before an existing one.  If the target item does not exist, this function silently fails, and the context menu not modified.
Replaces an existing item in the context menu.  If the target item does not exist, this function silently fails, and the context menu is not modified.


; context : A value describing the context under which to add the item.  See [[#Specifying Contexts]].
; context : A value describing the context under which to add the item.  See [[#Specifying Contexts]].
; target : A value describing the existing item before which to insert the new item.  See [[#Specifying Existing Menuitems]].
; target : A value describing the existing item to replace.  See [[#Specifying Existing Menuitems]].
; menuitem : The menuitem to add.  See [[#Specifying New Menuitems]].
; menuitem : The menuitem to add.  See [[#Specifying New Menuitems]].


Confirmed users
764

edits

Navigation menu