mirror of
https://github.com/scratchfoundation/scratch-blocks.git
synced 2025-08-28 22:10:31 -04:00
Remove sound and animation on delete during undo/redo.
This commit is contained in:
parent
2a2a6695da
commit
0242238a44
2 changed files with 3 additions and 3 deletions
|
@ -393,7 +393,7 @@ Blockly.Events.Create.prototype.run = function(forward) {
|
||||||
for (var i = 0, id; id = this.ids[i]; i++) {
|
for (var i = 0, id; id = this.ids[i]; i++) {
|
||||||
var block = workspace.getBlockById(id);
|
var block = workspace.getBlockById(id);
|
||||||
if (block) {
|
if (block) {
|
||||||
block.dispose(false, true);
|
block.dispose(false, false);
|
||||||
} else if (id == this.blockId) {
|
} else if (id == this.blockId) {
|
||||||
// Only complain about root-level block.
|
// Only complain about root-level block.
|
||||||
console.warn("Can't uncreate non-existant block: " + id);
|
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++) {
|
for (var i = 0, id; id = this.ids[i]; i++) {
|
||||||
var block = workspace.getBlockById(id);
|
var block = workspace.getBlockById(id);
|
||||||
if (block) {
|
if (block) {
|
||||||
block.dispose(false, true);
|
block.dispose(false, false);
|
||||||
} else if (id == this.blockId) {
|
} else if (id == this.blockId) {
|
||||||
// Only complain about root-level block.
|
// Only complain about root-level block.
|
||||||
console.warn("Can't delete non-existant block: " + id);
|
console.warn("Can't delete non-existant block: " + id);
|
||||||
|
|
|
@ -913,7 +913,7 @@ Blockly.WorkspaceSvg.prototype.playAudio = function(name, opt_volume) {
|
||||||
if (sound) {
|
if (sound) {
|
||||||
// Don't play one sound on top of another.
|
// Don't play one sound on top of another.
|
||||||
var now = new Date();
|
var now = new Date();
|
||||||
if (now - this.lastSound_ < Blockly.Blockly.SOUND_LIMIT) {
|
if (now - this.lastSound_ < Blockly.SOUND_LIMIT) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.lastSound_ = now;
|
this.lastSound_ = now;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue