remove leftover tags used during generation

This commit is contained in:
buzz-lightsnack-2007 2024-04-22 23:32:25 +08:00
parent db36adebe8
commit 7c1f303788

View file

@ -110,8 +110,13 @@ export default class windowman {
element.prepend(icon_element); element.prepend(icon_element);
} }
function clean() {
element.removeAttribute(`data-icon`);
};
swap(); swap();
iconify(); iconify();
clean();
}); });
} }
@ -140,6 +145,8 @@ export default class windowman {
} else { } else {
text_element.innerText = text_inserted; text_element.innerText = text_inserted;
} }
text_element.removeAttribute(`for`);
}); });
delete text_elements[`content`]; delete text_elements[`content`];
@ -162,6 +169,7 @@ export default class windowman {
} }
text_element.setAttribute(key, text_inserted); text_element.setAttribute(key, text_inserted);
text_element.removeAttribute(key.concat(`-for`));
}); });
} }
}); });
@ -181,11 +189,16 @@ export default class windowman {
if (buttons) { if (buttons) {
buttons.forEach((button) => { buttons.forEach((button) => {
let event = function () { // Get the data from the button.
// Get the data from the button. let target = {};
let target = {}; target[`source`] = button.getAttribute(`href`);
target[`source`] = this.getAttribute(`href`); target[`dimensions`] = {};
target[`dimensions`][`height`] = (button.getAttribute(`tab-height`)) ? button.getAttribute(`tab-height`)
: null;
target[`dimensions`][`width`] = (button.getAttribute(`tab-width`)) ? button.getAttribute(`tab-width`)
: null;
const event = function () {
// Get the correct path. // Get the correct path.
target[`path`] = ( target[`path`] = (
!target[`source`].includes(`://`) !target[`source`].includes(`://`)
@ -197,17 +210,11 @@ export default class windowman {
: `` : ``
).concat(target[`source`]); ).concat(target[`source`]);
windowman.new( windowman.new(target[`path`], target[`dimensions`][`height`], target[`dimensions`][`width`]);
target[`path`],
this.getAttribute(`tab-height`)
? this.getAttribute(`tab-height`)
: null,
this.getAttribute(`tab-width`)
? this.getAttribute(`tab-width`)
: null,
);
}; };
button.addEventListener("click", event); button.addEventListener("click", event);
button.removeAttribute(`href`);
}); });
} }
} }
@ -296,7 +303,7 @@ export default class windowman {
default: default:
input_element.value = value ? value : ``; input_element.value = value ? value : ``;
break; break;
} };
}); });
}); });
} }