MCPcopy
hub / github.com/RaspberryPiFoundation/blockly / setClass

Method setClass

packages/blockly/core/field_label.ts:144–154  ·  view source on GitHub ↗

* Set the CSS class applied to the field's textElement_. * * @param cssClass The new CSS class name, or null to remove.

(cssClass: string | null)

Source from the content-addressed store, hash-verified

142 * @param cssClass The new CSS class name, or null to remove.
143 */
144 setClass(cssClass: string | null) {
145 if (this.textElement_) {
146 if (this.class) {
147 dom.removeClass(this.textElement_, this.class);
148 }
149 if (cssClass) {
150 dom.addClass(this.textElement_, cssClass);
151 }
152 }
153 this.class = cssClass;
154 }
155
156 /**
157 * Construct a FieldLabel from a JSON arg object,

Calls 2

removeClassMethod · 0.45
addClassMethod · 0.45

Tested by

no test coverage detected