Make elements better.
This commit is contained in:
parent
38341f3475
commit
53e4edaf66
|
@ -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({
|
||||||
|
|
|
@ -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
|
||||||
});
|
});
|
||||||
}
|
}
|
|
@ -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,
|
||||||
});
|
});
|
||||||
}
|
}
|
Loading…
Reference in a new issue