From 4e0fe2458cf515f3e7263c97eff9b33d605b627e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20M=C3=B6nig?= Date: Tue, 28 Jul 2015 12:22:46 +0200 Subject: [PATCH] eep BlockEditors open when or keys are pressed --- byob.js | 10 ++++++---- history.txt | 2 ++ morphic.js | 6 +++--- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/byob.js b/byob.js index fefc5c1b..13392b5a 100644 --- a/byob.js +++ b/byob.js @@ -102,11 +102,11 @@ ArrowMorph, PushButtonMorph, contains, InputSlotMorph, ShadowMorph, ToggleButtonMorph, IDE_Morph, MenuMorph, copy, ToggleElementMorph, Morph, fontHeight, StageMorph, SyntaxElementMorph, SnapSerializer, CommentMorph, localize, CSlotMorph, SpeechBubbleMorph, MorphicPreferences, -SymbolMorph, isNil*/ +SymbolMorph, isNil, CursorMorph*/ // Global stuff //////////////////////////////////////////////////////// -modules.byob = '2015-July-27'; +modules.byob = '2015-July-28'; // Declarations @@ -1727,8 +1727,9 @@ BlockEditorMorph.prototype.popUp = function () { // BlockEditorMorph ops -BlockEditorMorph.prototype.accept = function () { +BlockEditorMorph.prototype.accept = function (origin) { // check DialogBoxMorph comment for accept() + if (origin instanceof CursorMorph) {return; } if (this.action) { if (typeof this.target === 'function') { if (typeof this.action === 'function') { @@ -1747,7 +1748,8 @@ BlockEditorMorph.prototype.accept = function () { this.close(); }; -BlockEditorMorph.prototype.cancel = function () { +BlockEditorMorph.prototype.cancel = function (origin) { + if (origin instanceof CursorMorph) {return; } //this.refreshAllBlockInstances(); this.close(); }; diff --git a/history.txt b/history.txt index 13f971c3..4b222a7e 100755 --- a/history.txt +++ b/history.txt @@ -2547,3 +2547,5 @@ ______ 150728 ------ * GUI: fixed relative urls, thanks, Michael! +* Morphic: escalate origin with “accept” and “cancel” events from text cursors +* BYOB: keep BlockEditors open when or keys are pressed diff --git a/morphic.js b/morphic.js index cad31495..e704f4a0 100644 --- a/morphic.js +++ b/morphic.js @@ -1048,7 +1048,7 @@ /*global window, HTMLCanvasElement, getMinimumFontHeight, FileReader, Audio, FileList, getBlurredShadowSupport*/ -var morphicVersion = '2015-July-27'; +var morphicVersion = '2015-July-28'; var modules = {}; // keep track of additional loaded modules var useBlurredShadows = getBlurredShadowSupport(); // check for Chrome-bug @@ -4736,7 +4736,7 @@ CursorMorph.prototype.accept = function () { if (world) { world.stopEditing(); } - this.escalateEvent('accept', null); + this.escalateEvent('accept', this); }; CursorMorph.prototype.cancel = function () { @@ -4745,7 +4745,7 @@ CursorMorph.prototype.cancel = function () { if (world) { world.stopEditing(); } - this.escalateEvent('cancel', null); + this.escalateEvent('cancel', this); }; CursorMorph.prototype.undo = function () {