mirror of
https://github.com/google/blockly.git
synced 2026-01-04 15:40:08 +01:00
fix: update applyColour documentation (#6998)
This commit is contained in:
committed by
GitHub
parent
d516e517d4
commit
bf8be1a4f9
@@ -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.
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user