mirror of https://github.com/zulip/zulip.git
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:
parent
e9df82ac31
commit
bc7bec9a95
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue