From 8e1dff708e2dd109eebde4fe7049cc147fb142a6 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Fri, 15 Mar 2019 09:59:52 -0700 Subject: [PATCH] apps: Simplify rendering logic using $.toggle. --- static/js/portico/landing-page.js | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/static/js/portico/landing-page.js b/static/js/portico/landing-page.js index 65d94379ee..2c9918cacc 100644 --- a/static/js/portico/landing-page.js +++ b/static/js/portico/landing-page.js @@ -119,18 +119,10 @@ var apps_events = function () { $(".image img").attr("src", version_info.image); $download_instructions.find("a").attr("href", version_info.install_guide); - if (version_info.show_instructions) { - $download_instructions.show(); - } else { - $download_instructions.hide(); - } - - if (version === "mac" || version === "windows" || version === "linux") { - $third_party_apps.show(); - } else { - $third_party_apps.hide(); - } - + $download_instructions.toggle(version_info.show_instructions); + $third_party_apps.toggle(version === "mac" || + version === "windows" || + version === "linux"); $download_android_apk.toggle(version === "android"); };