mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-11 21:09:00 +08:00
Document findItemIndex function in ContextMenu
This commit is contained in:
parent
27256cae9e
commit
bca27ad11f
@ -114,13 +114,23 @@ 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)
|
function findItemIndex(item)
|
||||||
{
|
{
|
||||||
for(var i in base.items)
|
for(var i in base.items)
|
||||||
{
|
{
|
||||||
if(base.items[i] == item)
|
if(base.items[i] == item)
|
||||||
|
{
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user