feat(StatusStackModal): introduce `prevAction` API
This adds a possible `prevAction` hook to `stackLayout.currentItem` which is triggered (if it exists) when the stack modal's back button is hit.
This commit is contained in:
parent
cf5461799f
commit
85ca2dc3b3
|
@ -60,10 +60,15 @@ StatusModal {
|
|||
rotation: 180
|
||||
visible: replaceItem || stackLayout.currentIndex > 0
|
||||
onClicked: {
|
||||
if (replaceItem)
|
||||
if (replaceItem) {
|
||||
replaceItem = null;
|
||||
else
|
||||
} else {
|
||||
let prevAction = stackLayout.currentItem.prevAction
|
||||
stackLayout.currentIndex--;
|
||||
if (typeof(prevAction) == "function") {
|
||||
prevAction()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue