mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-02 20:52:20 -07:00
Document findItemIndex function in ContextMenu
This commit is contained in:
parent
27256cae9e
commit
bca27ad11f
1 changed files with 10 additions and 0 deletions
|
|
@ -114,12 +114,22 @@ Menu
|
|||
}
|
||||
}
|
||||
|
||||
// Find the index of an item in the list of child items of this menu.
|
||||
//
|
||||
// This is primarily intended as a helper function so we do not have to
|
||||
// hard-code the position of the extruder selection actions.
|
||||
//
|
||||
// \param item The item to find the index of.
|
||||
//
|
||||
// \return The index of the item or -1 if it was not found.
|
||||
function findItemIndex(item)
|
||||
{
|
||||
for(var i in base.items)
|
||||
{
|
||||
if(base.items[i] == item)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue