eep BlockEditors open when <enter> or <esc> keys are pressed

pull/3/merge
Jens Mönig 2015-07-28 12:22:46 +02:00
rodzic ecc7f438b3
commit 4e0fe2458c
3 zmienionych plików z 11 dodań i 7 usunięć

10
byob.js
Wyświetl plik

@ -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();
};

Wyświetl plik

@ -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 <enter> or <esc> keys are pressed

Wyświetl plik

@ -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 () {