aboutsummaryrefslogtreecommitdiffstats
path: root/qt-mobile/qml/DiveDetails.qml
diff options
context:
space:
mode:
Diffstat (limited to 'qt-mobile/qml/DiveDetails.qml')
-rw-r--r--qt-mobile/qml/DiveDetails.qml10
1 files changed, 7 insertions, 3 deletions
diff --git a/qt-mobile/qml/DiveDetails.qml b/qt-mobile/qml/DiveDetails.qml
index b2744ec1e..7fc2a8be9 100644
--- a/qt-mobile/qml/DiveDetails.qml
+++ b/qt-mobile/qml/DiveDetails.qml
@@ -47,9 +47,7 @@ MobileComponents.Page {
iconName: state !== "view" ? "dialog-cancel" : "document-edit"
onTriggered: {
if (state === "edit") {
- // just cancel the edit state
- state = "view"
- Qt.inputMethod.hide()
+ endEditMode()
} else if (state === "add") {
// edit was canceled - so remove the dive from the dive list
manager.addDiveAborted(dive_id)
@@ -66,6 +64,12 @@ MobileComponents.Page {
diveDetailsListView.positionViewAtIndex(index, ListView.Beginning);
}
+ function endEditMode() {
+ // just cancel the edit state
+ state = "view";
+ Qt.inputMethod.hide();
+ }
+
function startEditMode() {
// set things up for editing - so make sure that the detailsEdit has
// all the right data (using the property aliases set up above)