diff options
| author | jmoenig <jens@moenig.org> | 2013-04-02 18:18:19 +0200 |
|---|---|---|
| committer | jmoenig <jens@moenig.org> | 2013-04-02 18:18:19 +0200 |
| commit | 895ab6ddeb93938a75e779d9b3c0344330472933 (patch) | |
| tree | 75440a1ebd19e5e9e92296d98b51b0264c83f2c0 /byob.js | |
| parent | 84fd877fa483d986a9651b7d5555455cce978cae (diff) | |
| download | snap-byow-895ab6ddeb93938a75e779d9b3c0344330472933.tar.gz snap-byow-895ab6ddeb93938a75e779d9b3c0344330472933.zip | |
Anchored Comments Enhancements
* the Block Editor now allows anchored comments,
* duplicating a block / script / sprite now also duplicates anchored
comments,
* deleting a block / script now also deletes anchored comments
Diffstat (limited to 'byob.js')
| -rw-r--r-- | byob.js | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -105,7 +105,7 @@ CommentMorph, localize, CSlotMorph*/ // Global stuff //////////////////////////////////////////////////////// -modules.byob = '2013-March-18'; +modules.byob = '2013-April-02'; // Declarations @@ -1420,7 +1420,6 @@ BlockEditorMorph.prototype.init = function (definition, target) { // create scripting area scripts = new ScriptsMorph(target); - scripts.allowsStickyComments = false; scripts.isDraggable = false; scripts.color = new Color(71, 71, 71); scripts.texture = 'scriptsPaneTexture.gif'; @@ -1440,6 +1439,14 @@ BlockEditorMorph.prototype.init = function (definition, target) { block = element.fullCopy(); block.setPosition(scripts.position().add(element.position())); scripts.add(block); + if (block instanceof BlockMorph) { + block.allComments().forEach(function (comment) { + comment.align(block); + }); + } + }); + proto.allComments().forEach(function (comment) { + comment.align(proto); }); scriptsFrame = new ScrollFrameMorph(scripts); @@ -1559,7 +1566,7 @@ BlockEditorMorph.prototype.updateDefinition = function () { if (morph instanceof PrototypeHatBlockMorph) { head = morph; } else if (morph instanceof BlockMorph || - morph instanceof CommentMorph) { + (morph instanceof CommentMorph && !morph.block)) { element = morph.fullCopy(); element.parent = null; element.setPosition(morph.position().subtract(pos)); |
