summaryrefslogtreecommitdiff
path: root/byob.js
diff options
context:
space:
mode:
authorjmoenig <jens@moenig.org>2013-04-02 18:18:19 +0200
committerjmoenig <jens@moenig.org>2013-04-02 18:18:19 +0200
commit895ab6ddeb93938a75e779d9b3c0344330472933 (patch)
tree75440a1ebd19e5e9e92296d98b51b0264c83f2c0 /byob.js
parent84fd877fa483d986a9651b7d5555455cce978cae (diff)
downloadsnap-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.js13
1 files changed, 10 insertions, 3 deletions
diff --git a/byob.js b/byob.js
index 29ab1b5..99e882c 100644
--- a/byob.js
+++ b/byob.js
@@ -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));