Fix 19 warnings in theme-related code. (#2523)

* Fix 19 warnings in theme-related code.

Resolves #2414

* Remove suppressPrefixSuffix property definition

The mixin code throws an error if property exists on both objects.

* eslint has strange ideas about indentation.
This commit is contained in:
Neil Fraser
2019-05-30 10:05:06 -07:00
committed by GitHub
parent 73ff710a4d
commit dce0b77424
8 changed files with 99 additions and 85 deletions

View File

@@ -691,11 +691,11 @@ Blockly.checkBlockColourConstant_ = function(
* @param {!Blockly.Theme} theme Theme for Blockly.
*/
Blockly.setTheme = function(theme) {
this.theme_ = theme;
Blockly.theme_ = theme;
var ws = Blockly.getMainWorkspace();
if (ws) {
this.refreshTheme_(ws);
Blockly.refreshTheme_(ws);
}
};
@@ -706,7 +706,7 @@ Blockly.setTheme = function(theme) {
*/
Blockly.refreshTheme_ = function(ws) {
// Update all blocks in workspace that have a style name.
this.updateBlockStyles_(ws.getAllBlocks().filter(
Blockly.updateBlockStyles_(ws.getAllBlocks().filter(
function(block) {
return block.getStyleName() !== undefined;
}
@@ -714,7 +714,7 @@ Blockly.refreshTheme_ = function(ws) {
// Update blocks in the flyout.
if (!ws.toolbox_ && ws.flyout_ && ws.flyout_.workspace_) {
this.updateBlockStyles_(ws.flyout_.workspace_.getAllBlocks());
Blockly.updateBlockStyles_(ws.flyout_.workspace_.getAllBlocks());
} else {
ws.refreshToolboxSelection();
}
@@ -750,7 +750,7 @@ Blockly.updateBlockStyles_ = function(blocks) {
* @return {Blockly.Theme} Theme for Blockly.
*/
Blockly.getTheme = function() {
return this.theme_;
return Blockly.theme_;
};
// Export symbols that would otherwise be renamed by Closure compiler.