mirror of
https://github.com/google/blockly.git
synced 2026-01-10 02:17:09 +01:00
Option for moving one block from stack.
See thread in support group before merging.
This commit is contained in:
@@ -950,9 +950,16 @@ Blockly.BlockSvg.prototype.onMouseMove_ = function(e) {
|
||||
Blockly.dragMode_ = Blockly.DRAG_FREE;
|
||||
Blockly.longStop_();
|
||||
this.workspace.setResizesEnabled(false);
|
||||
if (this.parentBlock_) {
|
||||
// Push this block to the very top of the stack.
|
||||
this.unplug();
|
||||
|
||||
var disconnectEffect = !!this.parentBlock_;
|
||||
// If in a stack, either split the stack, or pull out single block.
|
||||
var healStack = !Blockly.DRAG_STACK;
|
||||
if (e.metaKey) {
|
||||
healStack = !healStack;
|
||||
}
|
||||
// Push this block to the very top of the stack.
|
||||
this.unplug(healStack);
|
||||
if (disconnectEffect) {
|
||||
var group = this.getSvgRoot();
|
||||
group.translate_ = 'translate(' + newXY.x + ',' + newXY.y + ')';
|
||||
this.disconnectUiEffect();
|
||||
|
||||
@@ -54,10 +54,16 @@ Blockly.LONGPRESS = 750;
|
||||
|
||||
/**
|
||||
* Prevent a sound from playing if another sound preceded it within this many
|
||||
* miliseconds.
|
||||
* milliseconds.
|
||||
*/
|
||||
Blockly.SOUND_LIMIT = 100;
|
||||
|
||||
/**
|
||||
* When dragging a block out of a stack, split the stack in two (true), or drag
|
||||
* out the block healing the stack (false).
|
||||
*/
|
||||
Blockly.DRAG_STACK = true;
|
||||
|
||||
/**
|
||||
* The richness of block colours, regardless of the hue.
|
||||
* Must be in the range of 0 (inclusive) to 1 (exclusive).
|
||||
|
||||
Reference in New Issue
Block a user