plans: Remove unnecessary comparison-table conditional.

This commit is contained in:
Karl Stolley 2024-02-12 15:31:25 -06:00 committed by Tim Abbott
parent 5be2e8fa64
commit 5f509f5b0c
1 changed files with 9 additions and 16 deletions

View File

@ -148,23 +148,16 @@ $(() => {
$pricing_wrapper.removeClass("showing-cloud showing-self-hosted");
$pricing_wrapper.addClass(`showing-${tab_to_show.slice(1)}`);
const $comparison_table = $(".zulip-plans-comparison");
// Not all pages that show plans include the comparison
// table, but when it's present, make sure to align the
// comparison table with the current active plans tab
if ($comparison_table.length > 0) {
// Make sure that links coming from elsewhere scroll
// to the comparison table
if (target_hash.includes("plan-comparison")) {
document.querySelector(target_hash).scrollIntoView();
}
const plans_columns_count = tab_to_show.slice(1) === "self-hosted" ? 4 : 3;
// Set the correct values for span and colspan
$(".features-col-group").attr("span", plans_columns_count);
$(".subheader-filler").attr("colspan", plans_columns_count);
// Make sure that links coming from elsewhere scroll
// to the comparison table
if (target_hash.includes("plan-comparison")) {
document.querySelector(target_hash).scrollIntoView();
}
const plans_columns_count = tab_to_show.slice(1) === "self-hosted" ? 4 : 3;
// Set the correct values for span and colspan
$(".features-col-group").attr("span", plans_columns_count);
$(".subheader-filler").attr("colspan", plans_columns_count);
}
});