@wavemaker/m3-custom-widgets
Version:
A collection of custom widgets
34 lines (33 loc) • 1.28 kB
JavaScript
/*
* Use App.getDependency for Dependency Injection
* eg: var DialogService = App.getDependency('DialogService');
*/
/* perform any action on widgets/variables within this block */
Widget.onReady = function () {
/*
* variables can be accessed through 'Widget.Variables' property here
* e.g. to get dataSet in a staticVariable named 'loggedInUser' use following script
* Widget.Variables.loggedInUser.getData()
*
* widgets can be accessed through 'Widget.Widgets' property here
* e.g. to get value of text widget named 'username' use following script
* 'Widget.Widgets.username.datavalue'
*/
if (Widget.props.switch_type === "filled") {
if (Widget.props.icon === "icon") {
Widget.Widgets.toggle.class += ' filled-switch icon';
}
else if (Widget.props.icon === "icon-checked") {
Widget.Widgets.toggle.class += ' filled-switch icon-checked';
}
else {
Widget.Widgets.toggle.class += ' filled-switch';
}
}
else if (Widget.props.switch_type === "condensed") {
Widget.Widgets.toggle.class += ' condensed-switch';
}
else if (Widget.props.switch_type === "iOS") {
Widget.Widgets.toggle.class += ' iOS-switch';
}
};