mirror of
https://github.com/google/blockly.git
synced 2026-01-10 18:37:09 +01:00
Added event filtering to workspaceChanged in mutator. (#2320)
This commit is contained in:
@@ -141,6 +141,9 @@ Blockly.Mutator.prototype.createEditor_ = function() {
|
||||
var quarkXml = null;
|
||||
}
|
||||
var workspaceOptions = {
|
||||
// If you want to enable disabling, also remove the
|
||||
// event filter from workspaceChanged_ .
|
||||
disable: false,
|
||||
disabledPatternId: this.block_.workspace.options.disabledPatternId,
|
||||
languageTree: quarkXml,
|
||||
parentWorkspace: this.block_.workspace,
|
||||
@@ -315,9 +318,15 @@ Blockly.Mutator.prototype.setVisible = function(visible) {
|
||||
* Update the source block when the mutator's blocks are changed.
|
||||
* Bump down any block that's too high.
|
||||
* Fired whenever a change is made to the mutator's workspace.
|
||||
* @param {!Blockly.Events.Abstract} e Custom data for event.
|
||||
* @private
|
||||
*/
|
||||
Blockly.Mutator.prototype.workspaceChanged_ = function() {
|
||||
Blockly.Mutator.prototype.workspaceChanged_ = function(e) {
|
||||
if (e.type == Blockly.Events.UI ||
|
||||
(e.type == Blockly.Events.CHANGE && e.element == 'disabled')) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.workspace_.isDragging()) {
|
||||
var blocks = this.workspace_.getTopBlocks(false);
|
||||
var MARGIN = 20;
|
||||
|
||||
Reference in New Issue
Block a user