Creata pagina "user"
This commit is contained in:
47
SteUp.Shared/wwwroot/js/main.js
Normal file
47
SteUp.Shared/wwwroot/js/main.js
Normal file
@@ -0,0 +1,47 @@
|
||||
// Funzione goBack
|
||||
window.goBack = function () {
|
||||
console.log("goBack");
|
||||
history.back();
|
||||
};
|
||||
|
||||
// Funzione per aggiungere tabindex ai bottoni
|
||||
function addTabindexToButtons() {
|
||||
document.querySelectorAll('button.custom-plus-button').forEach(btn => {
|
||||
if (!btn.hasAttribute('tabindex')) {
|
||||
btn.setAttribute('tabindex', '0');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Esegui la funzione tabindex inizialmente
|
||||
addTabindexToButtons();
|
||||
|
||||
// Observer combinato per tutte le funzionalità
|
||||
const observer = new MutationObserver((mutations) => {
|
||||
// Aggiungi tabindex ai nuovi bottoni
|
||||
addTabindexToButtons();
|
||||
});
|
||||
|
||||
// Osserva sia i cambiamenti nel DOM che gli attributi
|
||||
observer.observe(document.body, {
|
||||
childList: true,
|
||||
subtree: true,
|
||||
attributes: true,
|
||||
attributeFilter: ['class']
|
||||
});
|
||||
|
||||
// Sync iniziale per la navbar (nel caso la pagina parte già con .show)
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
const bottomSheet = document.querySelector(".bottom-sheet-container");
|
||||
const navbar = document.querySelector(".animated-navbar");
|
||||
|
||||
if (bottomSheet && navbar) {
|
||||
if (bottomSheet.classList.contains("show")) {
|
||||
navbar.classList.remove("show-nav");
|
||||
navbar.classList.add("hide-nav");
|
||||
} else {
|
||||
navbar.classList.remove("hide-nav");
|
||||
navbar.classList.add("show-nav");
|
||||
}
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user