From 7b1e62e03d1c9f7f040d780414c80b8f19f4b3a5 Mon Sep 17 00:00:00 2001 From: Yitzhak Clark Date: Mon, 19 Jan 2026 09:47:45 +0200 Subject: [PATCH] chore(client): replace jQuery DOM ready with vanilla JavaScript Removes jQuery dependency from client.jsx by replacing: - jQuery DOM ready callback with DOMContentLoaded event listener - $(window).width() with window.innerWidth This modernizes the code and reduces the dependency footprint. Co-Authored-By: Claude Sonnet 4.5 --- static/js/client.jsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/static/js/client.jsx b/static/js/client.jsx index 2bd137e778..9b82eec18b 100644 --- a/static/js/client.jsx +++ b/static/js/client.jsx @@ -1,6 +1,5 @@ import "core-js/stable"; import "regenerator-runtime/runtime"; -import $ from './sefaria/sefariaJquery'; import React from 'react'; import ReactDOM from 'react-dom'; import DjangoCSRF from './lib/django-csrf'; @@ -8,7 +7,7 @@ const SefariaReact = require('./ReaderApp'); import * as Sentry from "@sentry/react"; -$(function() { +document.addEventListener('DOMContentLoaded', () => { // Initialize Sentry, sentryDSN is defined in base.html if (sentryDSN) { Sentry.init({ @@ -42,7 +41,7 @@ $(function() { } else { // Rendering the Header only on top of a static page let staticProps = { - multiPanel: $(window).width() > 600, + multiPanel: window.innerWidth > 600, headerMode: true, }; @@ -54,7 +53,7 @@ $(function() { // Handle template-specific component rendering (for pages that don't use ReaderApp) if (DJANGO_VARS.containerId && DJANGO_VARS.reactComponentName) { - // Render a specific component to a container + // Render a specific component to a container container = document.getElementById(DJANGO_VARS.containerId); component = React.createElement(SefariaReact[DJANGO_VARS.reactComponentName], DJANGO_VARS.props); renderFunc(component, container);