mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 21:34:54 +03:00
97e743ac14
Instead of duplicating javascript in every single page, put it in a standalone file which can be cached by the browser. Reviewed-by: Andrea Bolognani <abologna@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
26 lines
899 B
JavaScript
26 lines
899 B
JavaScript
function pageload() {
|
|
window.addEventListener('scroll', function(e){
|
|
var distanceY = window.pageYOffset || document.documentElement.scrollTop
|
|
var shrinkOn = 94
|
|
home = document.getElementById("home");
|
|
links = document.getElementById("jumplinks");
|
|
search = document.getElementById("search");
|
|
body = document.getElementById("body");
|
|
if (distanceY > shrinkOn) {
|
|
if (home.className != "navhide") {
|
|
body.className = "navhide"
|
|
home.className = "navhide"
|
|
links.className = "navhide"
|
|
search.className = "navhide"
|
|
}
|
|
} else {
|
|
if (home.className == "navhide") {
|
|
body.className = ""
|
|
home.className = ""
|
|
links.className = ""
|
|
search.className = ""
|
|
}
|
|
}
|
|
});
|
|
}
|