fix: update applyColour documentation (#6998)

This commit is contained in:
Maribeth Bottorff
2023-04-24 10:23:16 -07:00
committed by GitHub
parent d516e517d4
commit bf8be1a4f9
4 changed files with 9 additions and 10 deletions

View File

@@ -683,13 +683,18 @@ export abstract class Field<T = any> implements IASTNodeLocationSvg,
}
/**
* Updates the field to match the colour/style of the block. Should only be
* called by BlockSvg.applyColour().
* Updates the field to match the colour/style of the block.
*
* @internal
* Non-abstract sub-classes may wish to implement this if the colour of the
* field depends on the colour of the block. It will automatically be called
* at relevant times, such as when the parent block or renderer changes.
*
* See {@link
* https://developers.google.com/blockly/guides/create-custom-blocks/fields/customizing-fields/creating#matching_block_colours
* | the field documentation} for more information, or FieldDropdown for an
* example.
*/
applyColour() {}
// Non-abstract sub-classes may wish to implement this. See FieldDropdown.
/**
* Used by getSize() to move/resize any DOM elements, and get the new size.

View File

@@ -177,8 +177,6 @@ export class FieldColour extends Field<string> {
/**
* Updates text field to match the colour/style of the block.
*
* @internal
*/
override applyColour() {
if (!this.getConstants()!.FIELD_COLOUR_FULL_BLOCK) {

View File

@@ -431,8 +431,6 @@ export class FieldDropdown extends Field<string> {
/**
* Updates the dropdown arrow to match the colour/style of the block.
*
* @internal
*/
override applyColour() {
const style = (this.sourceBlock_ as BlockSvg).style;

View File

@@ -201,8 +201,6 @@ export abstract class FieldInput<T extends InputTypes> extends Field<string|T> {
/**
* Updates text field to match the colour/style of the block.
*
* @internal
*/
override applyColour() {
if (!this.sourceBlock_ || !this.getConstants()!.FULL_BLOCK_FIELDS) return;