Minor change to QML

CURA-6144
This commit is contained in:
Lipu Fei 2019-02-13 11:28:25 +01:00
parent 43b81c70db
commit c237222d3c

View file

@ -97,15 +97,17 @@ Item
// knowing the extruder position, try to find the item index in the model // knowing the extruder position, try to find the item index in the model
function getIndexByPosition(position) function getIndexByPosition(position)
{ {
var itemIndex = -1 // if position is not found, return -1
for (var item_index in model.items) for (var item_index in model.items)
{ {
var item = model.getItem(item_index) var item = model.getItem(item_index)
if (item.index == position) if (item.index == position)
{ {
return item_index itemIndex = item_index
break
} }
} }
return -1 return itemIndex
} }
onActivated: onActivated: