helpers: Remove dead bootstrap tabs code.

This commit is contained in:
Aman Agrawal 2024-01-12 07:58:14 +00:00 committed by Tim Abbott
parent c7a39312ab
commit 70ecdf2add
1 changed files with 0 additions and 22 deletions

View File

@ -148,28 +148,6 @@ export function update_discount_details(
$("#sponsorship-discount-details").text(discount_notice); $("#sponsorship-discount-details").text(discount_notice);
} }
let current_page: string;
function handle_hashchange(): void {
$(`#${CSS.escape(current_page)}-tabs.nav a[href="${CSS.escape(location.hash)}"]`).tab("show");
$("html").scrollTop(0);
}
export function set_tab(page: string): void {
const hash = location.hash;
if (hash) {
$(`#${CSS.escape(page)}-tabs.nav a[href="${CSS.escape(hash)}"]`).tab("show");
$("html").scrollTop(0);
}
$<HTMLAnchorElement>(`#${CSS.escape(page)}-tabs.nav-tabs a`).on("click", function () {
location.hash = this.hash;
});
current_page = page;
window.addEventListener("hashchange", handle_hashchange);
}
export function is_valid_input(elem: JQuery<HTMLFormElement>): boolean { export function is_valid_input(elem: JQuery<HTMLFormElement>): boolean {
return elem[0].checkValidity(); return elem[0].checkValidity();
} }