commit 1327d19db0d20bd9cd5f169defbf09a8e41f9db0
parent c47ec0c9322dcf7b565b3fb772f1249e68ed1487
Author: Jacob R. Edwards <jacob@jacobedwards.org>
Date: Wed, 9 Oct 2024 10:52:16 -0700
Allow ui.button to be used for textual buttons
Diffstat:
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/files/lib/ui.js b/files/lib/ui.js
@@ -31,11 +31,16 @@ export function input(name, memo, options) {
export function button(name, memo, icon, options) {
let button = input(name, memo, options)
- let attrs = {
- alt: name,
- type: "image",
- class: "icon",
- src: "/icons/" + icon + "-outline.svg"
+ let attrs
+ if (icon == null) {
+ attrs = { type: "button", value: name }
+ } else {
+ attrs = {
+ alt: name,
+ type: "image",
+ class: "icon",
+ src: "/icons/" + icon + "-outline.svg"
+ }
}
for (let i in attrs) {
console.debug("Button", name, i, attrs[i])