itemElement.dataset.value = item;
const deleteButton = document.createElement("span");
- deleteButton.classList.add("icon", "icon16", "fa-times", "jsDeleteItem", "jsTooltip", "pointer");
+ deleteButton.innerHTML = '<fa-icon size="16" name="xmark" solid></fa-icon>';
+ deleteButton.classList.add("jsDeleteItem", "jsTooltip", "pointer");
deleteButton.title = Language.get("wcf.global.button.delete");
deleteButton.addEventListener("click", (ev) => this.deleteItem(ev));
itemElement.append(deleteButton);
button.setAttribute("aria-hidden", "true");
inputAddon.appendChild(button);
- const icon = document.createElement("span");
- icon.classList.add("icon", "icon16", "fa-eye");
+ const icon = document.createElement("fa-icon");
+ icon.size = 16;
+ icon.setIcon("eye", false);
button.appendChild(icon);
button.addEventListener("click", () => {
}
}
-function toggle(input: HTMLInputElement, button: HTMLElement, icon: HTMLElement): void {
+function toggle(input: HTMLInputElement, button: HTMLElement, icon: FaIcon): void {
if (input.type === "password") {
- icon.classList.remove("fa-eye");
- icon.classList.add("fa-eye-slash");
+ icon.setIcon("eye-slash", false);
button.dataset.tooltip = Language.get("wcf.global.form.password.button.hide");
input.type = "text";
} else {
- icon.classList.add("fa-eye");
- icon.classList.remove("fa-eye-slash");
+ icon.setIcon("eye-slash", true);
button.dataset.tooltip = Language.get("wcf.global.form.password.button.show");
input.type = "password";
}
listItem.appendChild(pollOptionInput);
const sortHandle = document.createElement("span");
- sortHandle.classList.add("icon", "icon16", "fa-arrows", "sortableNodeHandle");
+ sortHandle.innerHTML = '<fa-icon size="16" name="up-down-left-right" solid></fa-icon>';
+ sortHandle.classList.add("sortableNodeHandle");
pollOptionInput.appendChild(sortHandle);
// buttons
const addButton = document.createElement("button");
- addButton.classList.add("icon", "icon16", "fa-plus", "jsTooltip", "jsAddOption", "pointer");
- addButton.setAttribute("title", Language.get("wcf.poll.button.addOption"));
+ addButton.innerHTML = '<fa-icon size="16" name="plus" solid></fa-icon>';
+ addButton.classList.add("jsTooltip", "jsAddOption");
+ addButton.title = Language.get("wcf.poll.button.addOption");
addButton.addEventListener("click", () => this.createOption());
pollOptionInput.appendChild(addButton);
const deleteButton = document.createElement("button");
- deleteButton.classList.add("icon", "icon16", "fa-times", "jsTooltip", "jsDeleteOption", "pointer");
- deleteButton.setAttribute("title", Language.get("wcf.poll.button.removeOption"));
+ deleteButton.innerHTML = '<fa-icon size="16" name="xmark" solid></fa-icon>';
+ deleteButton.classList.add("jsTooltip", "jsDeleteOption");
+ deleteButton.title = Language.get("wcf.poll.button.removeOption");
deleteButton.addEventListener("click", () => this.removeOption(deleteButton));
pollOptionInput.appendChild(deleteButton);
const itemElement = document.createElement("li");
itemElement.dataset.value = item;
const deleteButton = document.createElement("span");
- deleteButton.classList.add("icon", "icon16", "fa-times", "jsDeleteItem", "jsTooltip", "pointer");
+ deleteButton.innerHTML = '<fa-icon size="16" name="xmark" solid></fa-icon>';
+ deleteButton.classList.add("jsDeleteItem", "jsTooltip", "pointer");
deleteButton.title = Language.get("wcf.global.button.delete");
deleteButton.addEventListener("click", (ev) => this.deleteItem(ev));
itemElement.append(deleteButton);
button.classList.add("button", "inputSuffix", "jsTooltip");
button.setAttribute("aria-hidden", "true");
inputAddon.appendChild(button);
- const icon = document.createElement("span");
- icon.classList.add("icon", "icon16", "fa-eye");
+ const icon = document.createElement("fa-icon");
+ icon.size = 16;
+ icon.setIcon("eye", false);
button.appendChild(icon);
button.addEventListener("click", () => {
toggle(input, button, icon);
}
function toggle(input, button, icon) {
if (input.type === "password") {
- icon.classList.remove("fa-eye");
- icon.classList.add("fa-eye-slash");
+ icon.setIcon("eye-slash", false);
button.dataset.tooltip = Language.get("wcf.global.form.password.button.hide");
input.type = "text";
}
else {
- icon.classList.add("fa-eye");
- icon.classList.remove("fa-eye-slash");
+ icon.setIcon("eye-slash", true);
button.dataset.tooltip = Language.get("wcf.global.form.password.button.show");
input.type = "password";
}
pollOptionInput.classList.add("pollOptionInput");
listItem.appendChild(pollOptionInput);
const sortHandle = document.createElement("span");
- sortHandle.classList.add("icon", "icon16", "fa-arrows", "sortableNodeHandle");
+ sortHandle.innerHTML = '<fa-icon size="16" name="up-down-left-right" solid></fa-icon>';
+ sortHandle.classList.add("sortableNodeHandle");
pollOptionInput.appendChild(sortHandle);
// buttons
const addButton = document.createElement("button");
- addButton.classList.add("icon", "icon16", "fa-plus", "jsTooltip", "jsAddOption", "pointer");
- addButton.setAttribute("title", Language.get("wcf.poll.button.addOption"));
+ addButton.innerHTML = '<fa-icon size="16" name="plus" solid></fa-icon>';
+ addButton.classList.add("jsTooltip", "jsAddOption");
+ addButton.title = Language.get("wcf.poll.button.addOption");
addButton.addEventListener("click", () => this.createOption());
pollOptionInput.appendChild(addButton);
const deleteButton = document.createElement("button");
- deleteButton.classList.add("icon", "icon16", "fa-times", "jsTooltip", "jsDeleteOption", "pointer");
- deleteButton.setAttribute("title", Language.get("wcf.poll.button.removeOption"));
+ deleteButton.innerHTML = '<fa-icon size="16" name="xmark" solid></fa-icon>';
+ deleteButton.classList.add("jsTooltip", "jsDeleteOption");
+ deleteButton.title = Language.get("wcf.poll.button.removeOption");
deleteButton.addEventListener("click", () => this.removeOption(deleteButton));
pollOptionInput.appendChild(deleteButton);
// input field