1
0
Fork 0

Make elements better.

This commit is contained in:
Kitteh 2021-05-07 12:07:51 +01:00
parent 38341f3475
commit 53e4edaf66
3 changed files with 12 additions and 7 deletions

View file

@ -15,10 +15,12 @@ export function CopyableInputBox(text, copyable = true) {
"uk-icon": "icon: copy", "uk-icon": "icon: copy",
"role": "img", "role": "img",
"aria-label": i18next.t("copy_input_box_copy_icon_text") "aria-label": i18next.t("copy_input_box_copy_icon_text")
},
thenRun: (e) => {
let clipboard = new ClipboardJS(e);
addClipboardNotifications(clipboard, 600);
} }
}); });
let clipboard = new ClipboardJS(inputBoxCopyButton);
addClipboardNotifications(clipboard, 600);
} }
let inputBoxInput = makeElement({ let inputBoxInput = makeElement({

View file

@ -1,9 +1,10 @@
import { makeElement } from "../htmlUtils.js"; import { makeElement } from "../htmlUtils.js";
export function Margin(children) { export function Margin(children, options = {}) {
return makeElement({ return makeElement({
tag: "div", tag: "div",
class: "uk-margin", class: "uk-margin",
children: children children: children,
...options
}); });
} }

View file

@ -1,13 +1,15 @@
import { makeElement } from "../htmlUtils.js"; import { makeElement } from "../htmlUtils.js";
export function MarginInline(children) { export function MarginInline(children, marginOptions = {}, inlineOptions = {}) {
return makeElement({ return makeElement({
tag: "div", tag: "div",
class: "uk-margin", class: "uk-margin",
children: makeElement({ children: makeElement({
tag: "div", tag: "div",
class: "uk-inline", class: "uk-inline",
children: children children: children,
}) ...inlineOptions,
}),
...marginOptions,
}); });
} }