diff options
| author | jmoenig <jens@moenig.org> | 2013-08-02 08:33:07 +0200 |
|---|---|---|
| committer | jmoenig <jens@moenig.org> | 2013-08-02 08:33:07 +0200 |
| commit | 98eb26f7c2a17cf44aeb5331667fe241d1e15e18 (patch) | |
| tree | 0441b5f82e41c11c1aa0c23f9b268a6ae006072d | |
| parent | 4e409623b339345d15b94bfb25b4754184302494 (diff) | |
| download | snap-yow-98eb26f7c2a17cf44aeb5331667fe241d1e15e18.tar.gz snap-yow-98eb26f7c2a17cf44aeb5331667fe241d1e15e18.zip | |
Undrop Reporters feature tweaks
| -rw-r--r-- | blocks.js | 30 | ||||
| -rwxr-xr-x | history.txt | 4 |
2 files changed, 19 insertions, 15 deletions
@@ -155,7 +155,7 @@ DialogBoxMorph, BlockInputFragmentMorph, PrototypeHatBlockMorph*/ // Global stuff //////////////////////////////////////////////////////// -modules.blocks = '2013-August-01'; +modules.blocks = '2013-August-02'; var SyntaxElementMorph; var BlockMorph; @@ -3157,10 +3157,7 @@ CommandBlockMorph.prototype.snap = function () { offsetY, affected; - scripts.lastDroppedBlock = null; - scripts.parent.lastReplacedInput = null; - scripts.parent.lastDropTarget = null; - scripts.lastPreservedBlocks = null; + scripts.clearDropHistory(); if (target === null) { this.startLayout(); @@ -3180,7 +3177,7 @@ CommandBlockMorph.prototype.snap = function () { if (this.isStop()) { next = this.nextBlock(); if (next) { - this.parentThatIsA(ScriptsMorph).add(next); + scripts.add(next); next.moveBy(this.extent().floorDivideBy(2)); affected = this.parentThatIsA(CommandSlotMorph); if (affected) { @@ -3819,10 +3816,8 @@ ReporterBlockMorph.prototype.snap = function (hand) { return null; } + scripts.clearDropHistory(); scripts.lastDroppedBlock = this; - scripts.parent.lastReplacedInput = null; - scripts.parent.lastDropTarget = null; - scripts.lastPreservedBlocks = null; target = scripts.closestInput(this, hand); if (target !== null) { @@ -4882,6 +4877,15 @@ ScriptsMorph.prototype.undrop = function () { } } 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 @@ -10151,12 +10155,8 @@ CommentMorph.prototype.snap = function (hand) { return null; } - scripts.lastDroppedBlock = null; - scripts.parent.lastReplacedInput = null; - scripts.parent.lastDropTarget = null; - scripts.lastPreservedBlocks = null; - - target = this.parent.closestBlock(this, hand); + scripts.clearDropHistory(); + target = scripts.closestBlock(this, hand); if (target !== null) { target.comment = this; diff --git a/history.txt b/history.txt index a2ca3d5..87d62b5 100755 --- a/history.txt +++ b/history.txt @@ -1839,3 +1839,7 @@ ______ * Blocks, Threads: "whitespace" & other options in SPLIT reporter's dropdown * Blocks: Italicize editable input options (e.g. for the SPLT block) * Blocks: Undrop Reporters feature (in script areas' context menus) + +130802 +------ +* Blocks: Undrop Reporters feature tweaks |
