From 5f509f5b0c0b54eaf4526f332b192f97a8c885e8 Mon Sep 17 00:00:00 2001 From: Karl Stolley Date: Mon, 12 Feb 2024 15:31:25 -0600 Subject: [PATCH] plans: Remove unnecessary comparison-table conditional. --- web/src/portico/landing-page.js | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/web/src/portico/landing-page.js b/web/src/portico/landing-page.js index e0e239d087..82b7dc343b 100644 --- a/web/src/portico/landing-page.js +++ b/web/src/portico/landing-page.js @@ -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); } });