landing-page: Clean up ready callbacks.

jQuery’s $(callback) already checks document.readyState to decide
whether to run the callback immediately (that’s like, jQuery’s entire
value proposition).  We probably don’t need ready callbacks at all
anymore thanks to <script defer>, but that’s a larger change.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2020-07-22 12:40:28 -07:00 committed by Tim Abbott
parent e9df82ac31
commit bc7bec9a95
1 changed files with 1 additions and 10 deletions

View File

@ -201,8 +201,7 @@ const events = function () {
} }
}; };
// run this callback when the page is determined to have loaded. $(() => {
const load = function () {
// Initiate the bootstrap carousel logic // Initiate the bootstrap carousel logic
$(".carousel").carousel({ $(".carousel").carousel({
interval: false, interval: false,
@ -238,15 +237,7 @@ const load = function () {
// Set up events / categories / search // Set up events / categories / search
events(); events();
};
if (document.readyState === "complete") {
load();
} else {
$(load);
}
$(() => {
if (window.location.pathname === "/team/") { if (window.location.pathname === "/team/") {
render_tabs(); render_tabs();
} }