Skip to content

Commit e68d1c3

Browse files
committed
use ternary
1 parent e8cc5ef commit e68d1c3

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/bundle/Resources/public/ts/components/toggle_button/toggle_button_input.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,7 @@ export class ToggleButtonInput extends BaseChoiceInput {
3535
protected updateLabel(): void {
3636
const isChecked = this._inputElement.checked;
3737

38-
if (isChecked) {
39-
this.toggleLabelNode.textContent = this.labels.on;
40-
} else {
41-
this.toggleLabelNode.textContent = this.labels.off;
42-
}
38+
this.toggleLabelNode.textContent = isChecked ? this.labels.on : this.labels.off;
4339
}
4440

4541
protected initWidgets(): void {

0 commit comments

Comments
 (0)