Restructuring the Project
Updating dependencies
This commit is contained in:
33
FrontendLegacy/shared/inputs.js
Normal file
33
FrontendLegacy/shared/inputs.js
Normal file
@ -0,0 +1,33 @@
|
||||
(() => {
|
||||
const run = () => {
|
||||
document.querySelectorAll(".floating>input").forEach((e) => {
|
||||
function checkState() {
|
||||
if (e.value !== "") {
|
||||
if (e.classList.contains("used")) return;
|
||||
e.classList.add("used");
|
||||
} else {
|
||||
if (e.classList.contains("used")) e.classList.remove("used");
|
||||
}
|
||||
}
|
||||
|
||||
e.addEventListener("change", () => checkState());
|
||||
checkState();
|
||||
});
|
||||
};
|
||||
|
||||
run();
|
||||
|
||||
var mutationObserver = new MutationObserver(() => {
|
||||
run();
|
||||
});
|
||||
|
||||
mutationObserver.observe(document.documentElement, {
|
||||
attributes: false,
|
||||
characterData: false,
|
||||
childList: true,
|
||||
subtree: true,
|
||||
});
|
||||
|
||||
window.Mutt;
|
||||
window.addEventListener("DOMNodeInserted", () => run());
|
||||
})();
|
Reference in New Issue
Block a user