fix: revert "Delete events should animate when played (#5919)" (#6031)

* Revert "Delete events should animate when played (#5919)"

This reverts commit bce4c5e2c6.

* fix: lint in screenshot
This commit is contained in:
Beka Westberg
2022-03-29 11:47:50 -07:00
committed by GitHub
parent 2cf8eb87dc
commit c4a25eb3c4
5 changed files with 4 additions and 25 deletions

View File

@@ -386,10 +386,9 @@ class Block {
* @param {boolean} healStack If true, then try to heal any gap by connecting
* the next statement with the previous statement. Otherwise, dispose of
* all children of this block.
* @param {boolean=} _animate If true, show a disposal animation and sound.
* @suppress {checkTypes}
*/
dispose(healStack, _animate) {
dispose(healStack) {
if (!this.workspace) {
// Already deleted.
return;

View File

@@ -54,12 +54,6 @@ class BlockCreate extends BlockBase {
this.xml = Xml.blockToDomWithXY(opt_block);
this.ids = eventUtils.getDescendantIds(opt_block);
/**
* Play UI effects (sound and animation)?
* @type {boolean}
*/
this.ui = true;
/**
* JSON representation of the block that was just created.
* @type {!blocks.State}
@@ -77,7 +71,6 @@ class BlockCreate extends BlockBase {
json['xml'] = Xml.domToText(this.xml);
json['ids'] = this.ids;
json['json'] = this.json;
json['ui'] = this.ui;
if (!this.recordUndo) {
json['recordUndo'] = this.recordUndo;
}
@@ -93,7 +86,6 @@ class BlockCreate extends BlockBase {
this.xml = Xml.textToDom(json['xml']);
this.ids = json['ids'];
this.json = /** @type {!blocks.State} */ (json['json']);
this.ui = !!json['ui'];
if (json['recordUndo'] !== undefined) {
this.recordUndo = json['recordUndo'];
}
@@ -112,7 +104,7 @@ class BlockCreate extends BlockBase {
const id = this.ids[i];
const block = workspace.getBlockById(id);
if (block) {
block.dispose(false, this.ui);
block.dispose(false);
} else if (id === this.blockId) {
// Only complain about root-level block.
console.warn('Can\'t uncreate non-existent block: ' + id);

View File

@@ -63,12 +63,6 @@ class BlockDelete extends BlockBase {
*/
this.wasShadow = opt_block.isShadow();
/**
* Play UI effects (sound and animation)?
* @type {boolean}
*/
this.ui = true;
/**
* JSON representation of the block that was just deleted.
* @type {!blocks.State}
@@ -87,7 +81,6 @@ class BlockDelete extends BlockBase {
json['ids'] = this.ids;
json['wasShadow'] = this.wasShadow;
json['oldJson'] = this.oldJson;
json['ui'] = this.ui;
if (!this.recordUndo) {
json['recordUndo'] = this.recordUndo;
}
@@ -105,7 +98,6 @@ class BlockDelete extends BlockBase {
this.wasShadow =
json['wasShadow'] || this.oldXml.tagName.toLowerCase() === 'shadow';
this.oldJson = /** @type {!blocks.State} */ (json['oldJson']);
this.ui = !!json['ui'];
if (json['recordUndo'] !== undefined) {
this.recordUndo = json['recordUndo'];
}
@@ -122,7 +114,7 @@ class BlockDelete extends BlockBase {
const id = this.ids[i];
const block = workspace.getBlockById(id);
if (block) {
block.dispose(false, this.ui);
block.dispose(false);
} else if (id === this.blockId) {
// Only complain about root-level block.
console.warn('Can\'t delete non-existent block: ' + id);

View File

@@ -471,7 +471,6 @@ suite('Events', function() {
'x': 0,
'y': 0,
},
ui: true,
}),
},
{
@@ -491,7 +490,6 @@ suite('Events', function() {
'x': 0,
'y': 0,
},
ui: true,
recordUndo: false,
}),
},
@@ -513,7 +511,6 @@ suite('Events', function() {
'x': 0,
'y': 0,
},
ui: true,
}),
},
{
@@ -534,7 +531,6 @@ suite('Events', function() {
'x': 0,
'y': 0,
},
ui: true,
recordUndo: false,
}),
},

View File

@@ -105,4 +105,4 @@ function downloadScreenshot(workspace) {
a.click();
a.parentNode.removeChild(a);
});
};
}