kopia lustrzana https://github.com/backface/turtlestitch
eep BlockEditors open when <enter> or <esc> keys are pressed
rodzic
ecc7f438b3
commit
4e0fe2458c
10
byob.js
10
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();
|
||||
};
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 () {
|
||||
|
|
Ładowanie…
Reference in New Issue