summaryrefslogtreecommitdiff
path: root/blocks.js
diff options
context:
space:
mode:
authorjmoenig <jens@moenig.org>2013-09-30 14:41:59 +0200
committerjmoenig <jens@moenig.org>2013-09-30 14:41:59 +0200
commitdc709c2e1282e2056d74d3a9ba77e21b50d463f4 (patch)
treed2e8c31993f3b73b594a60ebe2172ab4f2f8386e /blocks.js
parent8eb98dc5b1b9f7377c3116df4f6399634557c313 (diff)
downloadsnap-byow-dc709c2e1282e2056d74d3a9ba77e21b50d463f4.tar.gz
snap-byow-dc709c2e1282e2056d74d3a9ba77e21b50d463f4.zip
fixed #186 (can't duplicate blocks with anchored comments)
Diffstat (limited to 'blocks.js')
-rw-r--r--blocks.js15
1 files changed, 7 insertions, 8 deletions
diff --git a/blocks.js b/blocks.js
index 4e85416..20e1e47 100644
--- a/blocks.js
+++ b/blocks.js
@@ -155,7 +155,7 @@ DialogBoxMorph, BlockInputFragmentMorph, PrototypeHatBlockMorph*/
// Global stuff ////////////////////////////////////////////////////////
-modules.blocks = '2013-August-02';
+modules.blocks = '2013-September-30';
var SyntaxElementMorph;
var BlockMorph;
@@ -2910,10 +2910,10 @@ BlockMorph.prototype.situation = function () {
// BlockMorph sticky comments
-BlockMorph.prototype.prepareToBeGrabbed = function () {
+BlockMorph.prototype.prepareToBeGrabbed = function (hand) {
var myself = this;
this.allComments().forEach(function (comment) {
- comment.startFollowing(myself);
+ comment.startFollowing(myself, hand.world);
});
};
@@ -10133,7 +10133,7 @@ CommentMorph.prototype.userMenu = function () {
menu.addItem(
"duplicate",
function () {
- this.fullCopy().pickUp(this.world());
+ myself.fullCopy().pickUp(myself.world());
},
'make a copy\nand pick it up'
);
@@ -10252,14 +10252,13 @@ CommentMorph.prototype.align = function (topBlock, ignoreLayer) {
}
};
-CommentMorph.prototype.startFollowing = function (topBlock) {
- var myself = this;
+CommentMorph.prototype.startFollowing = function (topBlock, world) {
this.align(topBlock);
- this.world().add(this);
+ world.add(this);
this.addShadow();
this.stickyOffset = this.position().subtract(this.block.position());
this.step = function () {
- myself.setPosition(this.block.position().add(myself.stickyOffset));
+ this.setPosition(this.block.position().add(this.stickyOffset));
};
};