Update src/html/index.html
This commit is contained in:
parent
90024f3b23
commit
e72bfae8e4
|
|
@ -512,5 +512,40 @@ function performActions(password, message, shouldCheckXSS, voteOption, qemuComma
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
<script>
|
||||||
|
var accountLink = document.getElementById('accountDropdownMenuLink');
|
||||||
|
var loginBtn = document.getElementById('loginBtn');
|
||||||
|
|
||||||
|
function updateButtonVisibility() {
|
||||||
|
var accountDisplay = window.getComputedStyle(accountLink).display;
|
||||||
|
if (accountDisplay !== 'none') {
|
||||||
|
loginBtn.style.display = 'none';
|
||||||
|
} else {
|
||||||
|
loginBtn.style.display = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
updateButtonVisibility();
|
||||||
|
|
||||||
|
var accountObserver = new MutationObserver(function(mutations) {
|
||||||
|
mutations.forEach(function(mutation) {
|
||||||
|
if (mutation.attributeName === 'style') {
|
||||||
|
updateButtonVisibility();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
accountObserver.observe(accountLink, { attributes: true, attributeFilter: ['style'] });
|
||||||
|
|
||||||
|
var buttonObserver = new MutationObserver(function(mutations) {
|
||||||
|
mutations.forEach(function(mutation) {
|
||||||
|
if (mutation.attributeName === 'style') {
|
||||||
|
updateButtonVisibility();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
buttonObserver.observe(loginBtn, { attributes: true, attributeFilter: ['style'] });
|
||||||
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user