From 0242238a4457f776c2055d3e7101c750dd8a94c1 Mon Sep 17 00:00:00 2001 From: Neil Fraser Date: Sat, 21 May 2016 06:14:33 -0700 Subject: [PATCH] Remove sound and animation on delete during undo/redo. --- core/events.js | 4 ++-- core/workspace_svg.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/events.js b/core/events.js index bc4299e55..9b9974478 100644 --- a/core/events.js +++ b/core/events.js @@ -393,7 +393,7 @@ Blockly.Events.Create.prototype.run = function(forward) { for (var i = 0, id; id = this.ids[i]; i++) { var block = workspace.getBlockById(id); if (block) { - block.dispose(false, true); + block.dispose(false, false); } else if (id == this.blockId) { // Only complain about root-level block. console.warn("Can't uncreate non-existant block: " + id); @@ -456,7 +456,7 @@ Blockly.Events.Delete.prototype.run = function(forward) { for (var i = 0, id; id = this.ids[i]; i++) { var block = workspace.getBlockById(id); if (block) { - block.dispose(false, true); + block.dispose(false, false); } else if (id == this.blockId) { // Only complain about root-level block. console.warn("Can't delete non-existant block: " + id); diff --git a/core/workspace_svg.js b/core/workspace_svg.js index 8e7db32ea..c2c46ad00 100644 --- a/core/workspace_svg.js +++ b/core/workspace_svg.js @@ -913,7 +913,7 @@ Blockly.WorkspaceSvg.prototype.playAudio = function(name, opt_volume) { if (sound) { // Don't play one sound on top of another. var now = new Date(); - if (now - this.lastSound_ < Blockly.Blockly.SOUND_LIMIT) { + if (now - this.lastSound_ < Blockly.SOUND_LIMIT) { return; } this.lastSound_ = now;