mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
mobile UI: undo partial dive add when canceling
When we start adding a dive, we actually create a diveAdd undo command so we have a dive that the user can edit. Which means we need to undo this action if we cancel. Also, for a more consistent UI, we should pop the dive details page that we used to edit this dive and bring the user back to the dive list. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
f2a48e813f
commit
0301fc6905
1 changed files with 9 additions and 1 deletions
|
@ -260,7 +260,15 @@ Kirigami.Page {
|
|||
}
|
||||
|
||||
function endEditMode() {
|
||||
// just cancel the edit/add state
|
||||
// we need to clean up either an edit or an add - and in case this
|
||||
// was an add, we need to undo the addDive action that created the empty dive
|
||||
// and we should also go back to the DiveDetails where we came from...
|
||||
manager.appendTextToLog("endEditMode called with state " + state)
|
||||
if (state === "add") {
|
||||
manager.undo()
|
||||
pageStack.pop()
|
||||
}
|
||||
// now all that is left is to cancel the edit/add state
|
||||
state = "view";
|
||||
focus = false;
|
||||
Qt.inputMethod.hide();
|
||||
|
|
Loading…
Add table
Reference in a new issue