[gnome-maps/wip/osm-edit: 46/47] osmEdit: Connect the cancel button to return to the view mode.



commit 27863a7f81ea92a7506443d4986fd568630dfe89
Author: Marcus Lundblad <ml update uu se>
Date:   Thu Mar 26 22:25:59 2015 +0100

    osmEdit: Connect the cancel button to return to the view mode.

 src/mapBubble.js |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/src/mapBubble.js b/src/mapBubble.js
index 5e16944..18841ac 100644
--- a/src/mapBubble.js
+++ b/src/mapBubble.js
@@ -81,7 +81,8 @@ const MapBubble = new Lang.Class({
                                                    'bubble-check-in-button',
                                                   'bubble-edit-button',
                                                   'bubble-edit-name-entry',
-                                                  'bubble-save-button']);
+                                                  'bubble-save-button',
+                                                  'bubble-cancel-button']);
        this._viewOrEditStack = ui.stack;
        this._mainGrid = ui.bubbleMainGrid;
        this._editGrid = ui.bubbleEditGrid;
@@ -89,6 +90,7 @@ const MapBubble = new Lang.Class({
         this._content = ui.bubbleContentArea;
        this._nameEntry = ui.bubbleEditNameEntry;
        this._saveButton = ui.bubbleSaveButton;
+       this._cancelButton = ui.bubbleCancelButton;
 
         if (!buttonFlags)
             ui.bubbleButtonArea.visible = false;
@@ -214,6 +216,7 @@ const MapBubble = new Lang.Class({
        }).bind(this));
 
        this._saveButton.connect('clicked', this._onSaveClicked.bind(this));
+       this._cancelButton.connect('clicked', this._onCancelClicked.bind(this));
     },
        
     _onObjectFetched: function(success, status, data) {
@@ -242,6 +245,10 @@ const MapBubble = new Lang.Class({
                                                this._uploadObjectCB.bind(this));
     },
 
+    _onCancelClicked: function() {
+       this._viewOrEditStack.visible_child_name = 'view';
+    },
+
     _uploadObjectCB: function(success, status) {
        // TODO: show error
        this._viewOrEditStack.visible_child_name = 'view';


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]