Mobile: for multiple buddies pick index of first

When a dive has multiple buddies, pick the index of the first
to prevent the user from hanving to scroll through the entire
list when editing.

Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
This commit is contained in:
Joakim Bygdell 2018-03-09 14:29:32 +01:00 committed by Dirk Hohndel
parent 6badba2bae
commit 93ba8f1a05

View file

@ -242,10 +242,11 @@ Kirigami.Page {
watertemp = currentItem.modelData.dive.waterTemp watertemp = currentItem.modelData.dive.waterTemp
suitIndex = manager.suitList.indexOf(currentItem.modelData.dive.suit) suitIndex = manager.suitList.indexOf(currentItem.modelData.dive.suit)
if (currentItem.modelData.dive.buddy.indexOf(",") > 0) { if (currentItem.modelData.dive.buddy.indexOf(",") > 0) {
buddyText = currentItem.modelData.dive.buddy; buddyIndex = manager.buddyList.indexOf(currentItem.modelData.dive.buddy.split(",", 1).toString())
} else { } else {
buddyIndex = manager.buddyList.indexOf(currentItem.modelData.dive.buddy) buddyIndex = manager.buddyList.indexOf(currentItem.modelData.dive.buddy)
} }
buddyText = currentItem.modelData.dive.buddy;
divemasterIndex = manager.divemasterList.indexOf(currentItem.modelData.dive.divemaster) divemasterIndex = manager.divemasterList.indexOf(currentItem.modelData.dive.divemaster)
notes = currentItem.modelData.dive.notes notes = currentItem.modelData.dive.notes
if (currentItem.modelData.dive.singleWeight) { if (currentItem.modelData.dive.singleWeight) {