summaryrefslogtreecommitdiff
path: root/gui.js
diff options
context:
space:
mode:
authorjmoenig <jens@moenig.org>2013-04-21 20:40:24 +0200
committerjmoenig <jens@moenig.org>2013-04-21 20:40:24 +0200
commitf21416527fd7f53b7c7eff6027a5511c4bccfaa7 (patch)
treec31f3009af9d6798c0c943ef1c601a9e1f10c484 /gui.js
parent977da0314c01ce8d3cda160cb913e12d4a980f36 (diff)
downloadsnap-f21416527fd7f53b7c7eff6027a5511c4bccfaa7.tar.gz
snap-f21416527fd7f53b7c7eff6027a5511c4bccfaa7.zip
Double click support for project dialogs
double clicking a project in the project dialog now performs the specified action for the dialog (open / save) on it.
Diffstat (limited to 'gui.js')
-rw-r--r--gui.js13
1 files changed, 10 insertions, 3 deletions
diff --git a/gui.js b/gui.js
index f2ac1ac..604ab06 100644
--- a/gui.js
+++ b/gui.js
@@ -68,7 +68,7 @@ sb, CommentMorph, CommandBlockMorph*/
// Global stuff ////////////////////////////////////////////////////////
-modules.gui = '2013-April-19';
+modules.gui = '2013-April-21';
// Declarations
@@ -3738,7 +3738,9 @@ ProjectDialogMorph.prototype.setSource = function (source) {
this.projectList.length > 0 ?
function (element) {
return element.name;
- } : null
+ } : null,
+ null,
+ function () {myself.ok(); }
);
this.fixListFieldItemColors();
@@ -3754,6 +3756,7 @@ ProjectDialogMorph.prototype.setSource = function (source) {
this.listField.action = function (item) {
var src, xml;
+ if (item === undefined) {return; }
if (myself.nameField) {
myself.nameField.setContents(item.name || '');
}
@@ -3775,6 +3778,7 @@ ProjectDialogMorph.prototype.setSource = function (source) {
};
} else { // 'examples', 'cloud' is initialized elsewhere
this.listField.action = function (item) {
+ if (item === undefined) {return; }
if (myself.nameField) {
myself.nameField.setContents(item.name || '');
}
@@ -3852,7 +3856,9 @@ ProjectDialogMorph.prototype.installCloudProjectList = function (pl) {
'bold',
function (proj) {return proj.Public === 'true'; }
]
- ]
+ ],
+ null,
+ function () {myself.ok(); }
);
this.fixListFieldItemColors();
@@ -3865,6 +3871,7 @@ ProjectDialogMorph.prototype.installCloudProjectList = function (pl) {
this.listField.drawRectBorder = InputFieldMorph.prototype.drawRectBorder;
this.listField.action = function (item) {
+ if (item === undefined) {return; }
if (myself.nameField) {
myself.nameField.setContents(item.ProjectName || '');
}