kopia lustrzana https://github.com/backface/turtlestitch
drag-origin support for blocks and comments duplicated inside a block editor
rodzic
c1668c4f15
commit
3c43d59bc3
18
blocks.js
18
blocks.js
|
@ -149,7 +149,7 @@ isSnapObject, copy, PushButtonMorph, SpriteIconMorph, Process*/
|
|||
|
||||
// Global stuff ////////////////////////////////////////////////////////
|
||||
|
||||
modules.blocks = '2016-November-23';
|
||||
modules.blocks = '2016-November-24';
|
||||
|
||||
var SyntaxElementMorph;
|
||||
var BlockMorph;
|
||||
|
@ -2378,8 +2378,15 @@ BlockMorph.prototype.userMenu = function () {
|
|||
"duplicate",
|
||||
function () {
|
||||
var dup = myself.fullCopy(),
|
||||
ide = myself.parentThatIsA(IDE_Morph);
|
||||
ide = myself.parentThatIsA(IDE_Morph),
|
||||
blockEditor = myself.parentThatIsA(BlockEditorMorph);
|
||||
dup.pickUp(world);
|
||||
// register the drop-origin, so the block can
|
||||
// slide back to its former situation if dropped
|
||||
// somewhere where it gets rejected
|
||||
if (!ide && blockEditor) {
|
||||
ide = blockEditor.target.parentThatIsA(IDE_Morph);
|
||||
}
|
||||
if (ide) {
|
||||
world.hand.grabOrigin = {
|
||||
origin: ide.palette,
|
||||
|
@ -5821,8 +5828,15 @@ ScriptsMorph.prototype.scriptsPicture = function () {
|
|||
|
||||
ScriptsMorph.prototype.addComment = function () {
|
||||
var ide = this.parentThatIsA(IDE_Morph),
|
||||
blockEditor = this.parentThatIsA(BlockEditorMorph),
|
||||
world = this.world();
|
||||
new CommentMorph().pickUp(world);
|
||||
// register the drop-origin, so the element can
|
||||
// slide back to its former situation if dropped
|
||||
// somewhere where it gets rejected
|
||||
if (!ide && blockEditor) {
|
||||
ide = blockEditor.target.parentThatIsA(IDE_Morph);
|
||||
}
|
||||
if (ide) {
|
||||
world.hand.grabOrigin = {
|
||||
origin: ide.palette,
|
||||
|
|
|
@ -3134,3 +3134,4 @@ http://snap.berkeley.edu/run#cloud:Username=jens&ProjectName=rotation
|
|||
161124
|
||||
------
|
||||
* Morphic, Store: work around a dreaded FF NS_ERROR_FAILURE for supporting retina
|
||||
* Blocks: drag-origin support for blocks and comments duplicated inside a block editor
|
||||
|
|
Ładowanie…
Reference in New Issue