UNPKG

@wavemaker/m3-custom-widgets

Version:

A collection of custom widgets

29 lines (28 loc) 1.22 kB
Widget.onReady = function () { var orientation_array = Widget.props.orientation.toLowerCase().split("/"); var orientation = orientation_array[0]; // Vertical or Horizontal var length = orientation_array[1]; Widget.Widgets.divider1.class = (" " + orientation + "-divider"); Widget.Widgets.divider1.class += (" " + length); var divider1 = Widget.Widgets.divider1; if (orientation === "vertical" && length === "full-width") { var vertical_height = "".concat(Widget.props.vertical_height, "px"); divider1.$element.css({ 'height': "".concat(vertical_height), }); } else if (orientation === "vertical" && length === "inset") { var vertical_height = Widget.props.vertical_height - 16; vertical_height = "".concat(vertical_height, "px"); divider1.$element.css({ 'height': "".concat(vertical_height), }); } else if (orientation === "vertical" && length === "middle-inset") { var vertical_height = Widget.props.vertical_height - 32; vertical_height = "".concat(vertical_height, "px"); divider1.$element.css({ 'height': "".concat(vertical_height), }); } };