[the-board] [things] Factor out method to start/stop editing photo caption
- From: Lucas Rocha <lucasr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [the-board] [things] Factor out method to start/stop editing photo caption
- Date: Mon, 11 Apr 2011 22:08:07 +0000 (UTC)
commit ec0863d4e56b47c42e96d7fe57af58b1cb40147c
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]