Option for moving one block from stack.

See thread in support group before merging.
This commit is contained in:
Neil Fraser
2017-01-07 23:56:09 -08:00
parent 5ab6f41fd3
commit c489ca1fc9
2 changed files with 17 additions and 4 deletions

View File

@@ -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();

View File

@@ -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).