Skip to content

Commit

Permalink
Support textKeys in label and tooltipText of a Switch (widget)
Browse files Browse the repository at this point in the history
357887
  • Loading branch information
andibur committed Jun 24, 2024
1 parent f9ad319 commit 58d53c0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion eclipse-scout-core/src/switch/Switch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
import {Device, EnumObject, HtmlComponent, KeyStrokeContext, objects, scout, strings, SwitchEventMap, SwitchModel, SwitchNavigationKeyStroke, SwitchToggleKeyStroke, tooltips, Widget} from '../index';
import {Device, EnumObject, HtmlComponent, InitModelOf, KeyStrokeContext, objects, scout, strings, SwitchEventMap, SwitchModel, SwitchNavigationKeyStroke, SwitchToggleKeyStroke, tooltips, Widget} from '../index';

export class Switch extends Widget implements SwitchModel {
declare model: SwitchModel;
Expand Down Expand Up @@ -47,6 +47,11 @@ export class Switch extends Widget implements SwitchModel {
this.$button = null;
}

protected override _init(model: InitModelOf<this>) {
super._init(model);
this.resolveTextKeys(['label', 'tooltipText']);
}

protected override _render() {
this.$container = this.$parent.appendDiv('switch')
.on('mousedown', this._onSwitchMouseDown.bind(this));
Expand Down

0 comments on commit 58d53c0

Please sign in to comment.