shadow inherited scripts on keyboard entry

upd4.1
Jens Mönig 2017-06-23 11:01:04 +02:00
rodzic 699515b317
commit 695e141f33
3 zmienionych plików z 10 dodań i 5 usunięć

Wyświetl plik

@ -3723,7 +3723,7 @@ BlockMorph.prototype.mouseClickLeft = function () {
shiftClicked = this.world().currentKey === 16,
stage;
if (shiftClicked && !this.isTemplate) {
return this.focus();
return this.selectForEdit().focus(); // enable coopy-on-edit
}
if (top instanceof PrototypeHatBlockMorph) {
return top.mouseClickLeft();
@ -6635,12 +6635,14 @@ ScriptsMorph.prototype.selectForEdit = function () {
// ScriptsMorph keyboard support
ScriptsMorph.prototype.edit = function (pos) {
var target;
var world = this.world();
if (this.focus) {this.focus.stopEditing(); }
world.stopEditing();
if (!ScriptsMorph.prototype.enableKeyboard) {return; }
this.focus = new ScriptFocusMorph(this, this, pos);
this.focus.getFocus(world);
target = this.selectForEdit(); // enable copy-on-edit
target.focus = new ScriptFocusMorph(target, target, pos);
target.focus.getFocus(world);
};
// ScriptsMorph context - scripts target

Wyświetl plik

@ -3463,6 +3463,7 @@ Fixes:
------
* Blocks: shadow inherited scripts on deleting blocks and comments via the context menu
* Blocks: shadow inherited scripts on “clean up”
* Blocks, Objects: shadow inherited scripts on keyboard entry
Features:

Wyświetl plik

@ -82,7 +82,7 @@ SpeechBubbleMorph, RingMorph, isNil, FileReader, TableDialogMorph,
BlockEditorMorph, BlockDialogMorph, PrototypeHatBlockMorph, localize,
TableMorph, TableFrameMorph, normalizeCanvas, BooleanSlotMorph, HandleMorph*/
modules.objects = '2017-June-22';
modules.objects = '2017-June-23';
var SpriteMorph;
var StageMorph;
@ -6449,7 +6449,9 @@ StageMorph.prototype.editScripts = function () {
scripts,
sorted;
if (ide.isAppMode || !ScriptsMorph.prototype.enableKeyboard) {return; }
scripts = this.parentThatIsA(IDE_Morph).currentSprite.scripts;
scripts = this.parentThatIsA(
IDE_Morph
).currentSprite.scripts.selectForEdit(); // shadow on edit, if inherited
scripts.edit(scripts.position());
sorted = scripts.focus.sortedScripts();
if (sorted.length) {