mirror of
https://github.com/wukko/cobalt.git
synced 2025-01-12 20:25:06 +01:00
elements: remove deprecated stuff
This commit is contained in:
parent
cc47f9fd8a
commit
210ac86e3f
1 changed files with 17 additions and 27 deletions
|
@ -179,14 +179,6 @@ export function settingsCategory(obj) {
|
||||||
export function footerButtons(obj) {
|
export function footerButtons(obj) {
|
||||||
let items = ``
|
let items = ``
|
||||||
for (let i = 0; i < obj.length; i++) {
|
for (let i = 0; i < obj.length; i++) {
|
||||||
switch (obj[i]["type"]) {
|
|
||||||
case "toggle":
|
|
||||||
items += `<button id="${obj[i]["name"]}-footer" class="switch footer-button" onclick="toggle('${obj[i]["name"]}')" aria-label="${obj[i]["aria"]}">${obj[i]["text"]}</button>`;
|
|
||||||
break;
|
|
||||||
case "action":
|
|
||||||
items += `<button id="${obj[i]["name"]}-footer" class="switch footer-button" onclick="${obj[i]["action"]}()" aria-label="${obj[i]["aria"]}">${obj[i]["text"]}</button>`;
|
|
||||||
break;
|
|
||||||
case "popup":
|
|
||||||
let buttonName = obj[i]["context"] ? `${obj[i]["name"]}-${obj[i]["context"]}` : obj[i]["name"],
|
let buttonName = obj[i]["context"] ? `${obj[i]["name"]}-${obj[i]["context"]}` : obj[i]["name"],
|
||||||
context = obj[i]["context"] ? `, '${obj[i]["context"]}'` : '',
|
context = obj[i]["context"] ? `, '${obj[i]["context"]}'` : '',
|
||||||
buttonName2,
|
buttonName2,
|
||||||
|
@ -197,14 +189,12 @@ export function footerButtons(obj) {
|
||||||
context2 = obj[i + 1]["context"] ? `, '${obj[i + 1]["context"]}'` : '';
|
context2 = obj[i + 1]["context"] ? `, '${obj[i + 1]["context"]}'` : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
items += `
|
items +=
|
||||||
<div class="footer-pair">
|
`<div class="footer-pair">
|
||||||
<button id="${buttonName}-footer" class="switch footer-button" onclick="popup('${obj[i]["name"]}', 1${context})" aria-label="${obj[i]["aria"]}">${obj[i]["text"]}</button>
|
<button id="${buttonName}-footer" class="switch footer-button" onclick="popup('${obj[i]["name"]}', 1${context})" aria-label="${obj[i]["aria"]}">${obj[i]["text"]}</button>
|
||||||
${obj[i + 1] ? `<button id="${buttonName2}-footer" class="switch footer-button" onclick="popup('${obj[i + 1]["name"]}', 1${context2})" aria-label="${obj[i + 1]["aria"]}">${obj[i + 1]["text"]}</button>` : ''}
|
${obj[i + 1] ? `<button id="${buttonName2}-footer" class="switch footer-button" onclick="popup('${obj[i + 1]["name"]}', 1${context2})" aria-label="${obj[i + 1]["aria"]}">${obj[i + 1]["text"]}</button>` : ''}
|
||||||
</div>`;
|
</div>`;
|
||||||
i++;
|
i++;
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return `
|
return `
|
||||||
<div id="footer-buttons">${items}</div>`
|
<div id="footer-buttons">${items}</div>`
|
||||||
|
|
Loading…
Reference in a new issue