Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove jQuery hide and show statements for elements selected by ID #916

Closed
Jaifroid opened this issue Nov 14, 2022 · 1 comment
Closed
Assignees
Labels
cleanup remove-jquery Issues or PRs involving removal of jQuery
Milestone

Comments

@Jaifroid
Copy link
Member

This is a sub-issue of #367. The vast majority of our usage of jQuery is in the form of simple hide/show statements based on DOM elements selected by ID.

There are two ways of doing this:

  1. Simply substitute the jQuery #selector with document.getElementById('selector').style.display = '' or 'none' respectively (this can be done with some carefully crafted regexes as a mass search and replace);
  2. Perhaps more elegantly, have a section at the start of app.js that defines variables for each DOM element like var #selector = document.getElementById('selector'); and then substitute the jQuery selector with #selector.style.display = '' or 'none'.

The disadvantage of 2 is that it is a slower process, and a similar selector block would be needed for each file that uses jQuery methods on the DOM (e.g. app.js, uiUtli.js). But it would reduce the overall amount of code in the end. Gain compared to 1 wouldn't be noticeable in any of our supported browsers.

@Jaifroid Jaifroid added the remove-jquery Issues or PRs involving removal of jQuery label Nov 14, 2022
@Jaifroid Jaifroid added this to the v3.7 milestone Nov 14, 2022
@Jaifroid Jaifroid self-assigned this Nov 14, 2022
@Jaifroid
Copy link
Member Author

Fixed in #917.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup remove-jquery Issues or PRs involving removal of jQuery
Projects
None yet
Development

No branches or pull requests

1 participant