mobile UI: use undo-command for adding dive.

Instead of using the model, copy the code we have in the desktop version
which manually creates a 15m/40min dive and passes that to the addDive
undo command.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Berthold Stoeger 2020-01-01 23:45:52 +01:00 committed by Dirk Hohndel
parent 2ad7b26f4b
commit 5493e7cbf6
3 changed files with 21 additions and 13 deletions

View file

@ -228,9 +228,6 @@ Kirigami.Page {
}
function endEditMode() {
// if we were adding a dive, we need to remove it
if (state === "add")
manager.addDiveAborted(dive_id)
// just cancel the edit/add state
state = "view";
focus = false;