mirror of
https://github.com/google/blockly.git
synced 2026-01-07 09:00:11 +01:00
chore: Reduce delta on ports to blockly-samples (#6886)
* Reduce usage of obsolete .keyCode property.
* Rename private properties/methods which violate eslint rules.
* Use arrays of bound events rather than individual properties.
* Improve typing info.
* Also fix O(n^2) recursive performance issue in theme's getComponentStyle function.
* And replace String(...) with '${...}' (smaller, faster).
* .toString() is considered harmful.
This commit is contained in:
@@ -261,10 +261,8 @@ export function registerDeleteAll() {
|
||||
const deletableBlocksLength = getDeletableBlocks_(scope.workspace).length;
|
||||
if (deletableBlocksLength === 1) {
|
||||
return Msg['DELETE_BLOCK'];
|
||||
} else {
|
||||
return Msg['DELETE_X_BLOCKS'].replace(
|
||||
'%1', String(deletableBlocksLength));
|
||||
}
|
||||
return Msg['DELETE_X_BLOCKS'].replace('%1', `${deletableBlocksLength}`);
|
||||
},
|
||||
preconditionFn(scope: Scope) {
|
||||
if (!scope.workspace) {
|
||||
@@ -489,7 +487,7 @@ export function registerDelete() {
|
||||
}
|
||||
return descendantCount === 1 ?
|
||||
Msg['DELETE_BLOCK'] :
|
||||
Msg['DELETE_X_BLOCKS'].replace('%1', String(descendantCount));
|
||||
Msg['DELETE_X_BLOCKS'].replace('%1', `${descendantCount}`);
|
||||
},
|
||||
preconditionFn(scope: Scope) {
|
||||
if (!scope.block!.isInFlyout && scope.block!.isDeletable()) {
|
||||
|
||||
Reference in New Issue
Block a user