From 8ef2c0a604927ffa17773f8141366be4e508adf4 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Wed, 16 Mar 2022 14:19:29 -0700 Subject: [PATCH] js: Fix no-jquery/no-ready-shorthand. The ready method was deprecated in jQuery 3.0, because its behavior has nothing to do with the selector; it always waits for the page to become ready, not a specific element. Signed-off-by: Anders Kaseorg --- static/js/emoji_picker.js | 2 +- static/js/settings.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/static/js/emoji_picker.js b/static/js/emoji_picker.js index 458bcafffd..c477fadb0e 100644 --- a/static/js/emoji_picker.js +++ b/static/js/emoji_picker.js @@ -641,7 +641,7 @@ export function build_emoji_popover($elt, id) { }; show_emoji_catalog(); - $elt.ready(() => refill_section_head_offsets($popover)); + $(() => refill_section_head_offsets($popover)); register_popover_events($popover); } diff --git a/static/js/settings.js b/static/js/settings.js index 9b389f8298..36bdc6a388 100644 --- a/static/js/settings.js +++ b/static/js/settings.js @@ -22,7 +22,7 @@ import {user_settings} from "./user_settings"; export let settings_label; -$("body").ready(() => { +$(() => { $("#settings_overlay_container").on("click", (e) => { if (!overlays.is_modal_open()) { return;