Jens Mönig 2016-07-06 23:25:46 +02:00
rodzic 2692f1d4e5
commit 23c8ad2208
2 zmienionych plików z 10 dodań i 2 usunięć

Wyświetl plik

@ -149,7 +149,7 @@ isSnapObject, copy, PushButtonMorph, SpriteIconMorph*/
// Global stuff ////////////////////////////////////////////////////////
modules.blocks = '2016-July-05';
modules.blocks = '2016-July-06';
var SyntaxElementMorph;
var BlockMorph;
@ -3735,6 +3735,9 @@ CommandBlockMorph.prototype.allAttachTargets = function (newParent) {
answer = [],
topBlocks;
if (this instanceof HatBlockMorph && newParent.rejectsHats) {
return answer;
}
topBlocks = target.children.filter(function (child) {
return (child !== myself) &&
child instanceof SyntaxElementMorph &&
@ -5208,6 +5211,7 @@ ScriptsMorph.prototype.init = function (owner) {
this.owner = owner || null;
this.feedbackColor = SyntaxElementMorph.prototype.feedbackColor;
this.feedbackMorph = new BoxMorph();
this.rejectsHats = false;
// "undrop" attributes:
this.lastDroppedBlock = null;
@ -5739,6 +5743,9 @@ ScriptsMorph.prototype.fixMultiArgs = function () {
ScriptsMorph.prototype.wantsDropOf = function (aMorph) {
// override the inherited method
if (aMorph instanceof HatBlockMorph) {
return !this.rejectsHats;
}
return aMorph instanceof SyntaxElementMorph ||
aMorph instanceof CommentMorph;
};

Wyświetl plik

@ -108,7 +108,7 @@ WatcherMorph, Variable*/
// Global stuff ////////////////////////////////////////////////////////
modules.byob = '2016-July-04';
modules.byob = '2016-July-06';
// Declarations
@ -1775,6 +1775,7 @@ BlockEditorMorph.prototype.init = function (definition, target) {
// create scripting area
scripts = new ScriptsMorph(target);
scripts.rejectsHats = true;
scripts.isDraggable = false;
scripts.color = IDE_Morph.prototype.groupColor;
scripts.cachedTexture = IDE_Morph.prototype.scriptsPaneTexture;