kopia lustrzana https://github.com/backface/turtlestitch
Undrop Reporters feature tweaks
rodzic
4e409623b3
commit
98eb26f7c2
30
blocks.js
30
blocks.js
|
@ -155,7 +155,7 @@ DialogBoxMorph, BlockInputFragmentMorph, PrototypeHatBlockMorph*/
|
||||||
|
|
||||||
// Global stuff ////////////////////////////////////////////////////////
|
// Global stuff ////////////////////////////////////////////////////////
|
||||||
|
|
||||||
modules.blocks = '2013-August-01';
|
modules.blocks = '2013-August-02';
|
||||||
|
|
||||||
var SyntaxElementMorph;
|
var SyntaxElementMorph;
|
||||||
var BlockMorph;
|
var BlockMorph;
|
||||||
|
@ -3157,10 +3157,7 @@ CommandBlockMorph.prototype.snap = function () {
|
||||||
offsetY,
|
offsetY,
|
||||||
affected;
|
affected;
|
||||||
|
|
||||||
scripts.lastDroppedBlock = null;
|
scripts.clearDropHistory();
|
||||||
scripts.parent.lastReplacedInput = null;
|
|
||||||
scripts.parent.lastDropTarget = null;
|
|
||||||
scripts.lastPreservedBlocks = null;
|
|
||||||
|
|
||||||
if (target === null) {
|
if (target === null) {
|
||||||
this.startLayout();
|
this.startLayout();
|
||||||
|
@ -3180,7 +3177,7 @@ CommandBlockMorph.prototype.snap = function () {
|
||||||
if (this.isStop()) {
|
if (this.isStop()) {
|
||||||
next = this.nextBlock();
|
next = this.nextBlock();
|
||||||
if (next) {
|
if (next) {
|
||||||
this.parentThatIsA(ScriptsMorph).add(next);
|
scripts.add(next);
|
||||||
next.moveBy(this.extent().floorDivideBy(2));
|
next.moveBy(this.extent().floorDivideBy(2));
|
||||||
affected = this.parentThatIsA(CommandSlotMorph);
|
affected = this.parentThatIsA(CommandSlotMorph);
|
||||||
if (affected) {
|
if (affected) {
|
||||||
|
@ -3819,10 +3816,8 @@ ReporterBlockMorph.prototype.snap = function (hand) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
scripts.clearDropHistory();
|
||||||
scripts.lastDroppedBlock = this;
|
scripts.lastDroppedBlock = this;
|
||||||
scripts.parent.lastReplacedInput = null;
|
|
||||||
scripts.parent.lastDropTarget = null;
|
|
||||||
scripts.lastPreservedBlocks = null;
|
|
||||||
|
|
||||||
target = scripts.closestInput(this, hand);
|
target = scripts.closestInput(this, hand);
|
||||||
if (target !== null) {
|
if (target !== null) {
|
||||||
|
@ -4882,6 +4877,15 @@ ScriptsMorph.prototype.undrop = function () {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.lastDroppedBlock.pickUp(this.world());
|
this.lastDroppedBlock.pickUp(this.world());
|
||||||
|
this.clearDropHistory();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
ScriptsMorph.prototype.clearDropHistory = function () {
|
||||||
|
this.lastDroppedBlock = null;
|
||||||
|
this.lastReplacedInput = null;
|
||||||
|
this.lastDropTarget = null;
|
||||||
|
this.lastPreservedBlocks = null;
|
||||||
};
|
};
|
||||||
|
|
||||||
// ScriptsMorph blocks layout fix
|
// ScriptsMorph blocks layout fix
|
||||||
|
@ -10151,12 +10155,8 @@ CommentMorph.prototype.snap = function (hand) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
scripts.lastDroppedBlock = null;
|
scripts.clearDropHistory();
|
||||||
scripts.parent.lastReplacedInput = null;
|
target = scripts.closestBlock(this, hand);
|
||||||
scripts.parent.lastDropTarget = null;
|
|
||||||
scripts.lastPreservedBlocks = null;
|
|
||||||
|
|
||||||
target = this.parent.closestBlock(this, hand);
|
|
||||||
|
|
||||||
if (target !== null) {
|
if (target !== null) {
|
||||||
target.comment = this;
|
target.comment = this;
|
||||||
|
|
|
@ -1839,3 +1839,7 @@ ______
|
||||||
* Blocks, Threads: "whitespace" & other options in SPLIT reporter's dropdown
|
* Blocks, Threads: "whitespace" & other options in SPLIT reporter's dropdown
|
||||||
* Blocks: Italicize editable input options (e.g. for the SPLT block)
|
* Blocks: Italicize editable input options (e.g. for the SPLT block)
|
||||||
* Blocks: Undrop Reporters feature (in script areas' context menus)
|
* Blocks: Undrop Reporters feature (in script areas' context menus)
|
||||||
|
|
||||||
|
130802
|
||||||
|
------
|
||||||
|
* Blocks: Undrop Reporters feature tweaks
|
||||||
|
|
Ładowanie…
Reference in New Issue