[the-board/cheese: 2/10] [things] Factor out method to start/stop editing photo caption



commit d239152fba23b9000dce127724ad4184d4fa96e7
Author: Lucas Rocha <lucasr gnome org>
Date:   Sun Apr 3 11:03:00 2011 +0100

    [things] Factor out method to start/stop editing photo caption

 src/js/ui/things/photo.js |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/src/js/ui/things/photo.js b/src/js/ui/things/photo.js
index bb79860..5d0c373 100644
--- a/src/js/ui/things/photo.js
+++ b/src/js/ui/things/photo.js
@@ -258,6 +258,15 @@ PhotoThing.prototype = {
                                   false /* not from state*/);
     },
 
+    _startEditingCaption : function() {
+        this._captionLabel.clutterText.editable = true;
+        this._captionLabel.clutterText.grab_key_focus();
+    },
+
+    _stopEditingCaption : function() {
+        this._captionLabel.clutterText.editable = false;
+    },
+
     _onCaptionTextKeyPressEvent : function(o, event) {
         let key = event.get_key_symbol();
 
@@ -316,12 +325,11 @@ PhotoThing.prototype = {
     },
 
     activate : function() {
-        this._captionLabel.clutterText.editable = true;
-        this._captionLabel.clutterText.grab_key_focus();
+        this._startEditingCaption();
     },
 
     deactivate : function() {
-        this._captionLabel.clutterText.editable = false;
+        this._stopEditingCaption();
     },
 
     loadState : function(state) {



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