-
Notifications
You must be signed in to change notification settings - Fork 0
Button Row
Simon Tharby edited this page Sep 28, 2020
·
5 revisions
percentW
(width as a percentage of row width) values must sum to 100
for each row.
Can include any number and combination of toggle &/or action buttons (providing the name given fits on the button).
Format:
addButtonRow(
parent, [
[name, type, percentW, state], // 1st button
[name, type, percentW], // 2nd button
]);
Example usage (see uiLayout.js for more examples):
let parent = document.getElementById("ui-container");
addButtonRow(
parent, [
["toggle_me", "toggle", 50, true] // toggle button
["action_A", "action", 50] // action button
]);
Example of generated HTML:
<div class="button-row">
<div class="button" id="toggle_me" style="width: 142.5px; color: rgb(223, 238, 240);">
<p class="button-text">toggle me</p>
</div>
<div class="button" id="action_A" style="width: 142.5px;">
<p class="button-text">action A</p>
</div>
</div>