Skip to main content

Hawaii Department of Commerce and Consumer Affairs, Office of Consumer Protection, Landlord Tenant Information Center

Citation
Hawaii Department of Commerce and Consumer Affairs, Office of Consumer Protection, Landlord Tenant Information Center
Jurisdiction
Hawaii (state)
Source
Official source

Related Parts of This Source

Full Text

1,741 chars
function fixLangLabels() {
var container = document.querySelector(".gt_white_content") || document.querySelector(".gtranslate_wrapper");
if (!container) return;
fixBrokenFlagSrcs();
var idx = 0;
container.querySelectorAll("a.glink").forEach(function(a) {
var span = a.querySelector("span");
if (!span || (span.textContent || "").trim() !== "undefined" || idx >= langData.length) return;
var data = langData[idx];
span.textContent = data.name;
var img = a.querySelector("img");
if (!img) {
img = document.createElement("img");
img.alt = "";
img.setAttribute("aria-hidden", "true");
img.style.cssText = "width:24px;height:24px;border-radius:4px;margin-right:16px;";
a.insertBefore(img, a.firstChild);
}
img.src = flagUrls[data.cdn] + data.flag + ".svg";
idx++;
});
}

function runFix() {
fixLangLabels();
setTimeout(fixLangLabels, 150);
setTimeout(fixLangLabels, 600);
}

document.addEventListener("DOMContentLoaded", function() {
runFix();
setTimeout(runFix, 2500);
});
document.addEventListener("click", function(e) {
if (e.target.closest(".gt_switcher-popup, .gt_container-unisv1")) setTimeout(runFix, 400);
}, true);
})();

let lastScrollTop = 0;
let disableScrollBehavior = false;

const header = document.querySelector('header');
const megaMenu = document.querySelector('.mega-menu-wrap');

// Disable scroll behavior on specific clicks
document.addEventListener('click', (e) => {
if (
e.target.closest('.section-navigation .scroll-wrapper li a') ||
e.target.closest('.section-navigation .scroll-btn')
) {
disableScrollBehavior = true;

// Re-enable after scrolling finishes
setTimeout(() => {
disableScrollBehavior = false;
}, 800); // adjust if needed
}
});

window.addEventListener('scroll', () => {
if (disableScrollBehavior) return;