From f21416527fd7f53b7c7eff6027a5511c4bccfaa7 Mon Sep 17 00:00:00 2001 From: jmoenig Date: Sun, 21 Apr 2013 20:40:24 +0200 Subject: 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. --- gui.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'gui.js') 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 || ''); } -- cgit v1.3.1