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

WebUI: Replace Mootools class list manipulation methods #21946

Merged
merged 5 commits into from
Dec 8, 2024

Conversation

skomerko
Copy link
Contributor

@skomerko skomerko commented Dec 3, 2024

All addClass(), removeClass() and hasClass() instances were changed to use classList equivalent:
https://developer.mozilla.org/en-US/docs/Web/API/Element/classList

@xavier2k6 xavier2k6 added the WebUI WebUI-related issues/changes label Dec 4, 2024
Copy link
Member

@Chocobo1 Chocobo1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only some minor comments about coding style.
Unfortunately related CI tools couldn't detect such instances...

src/webui/www/private/scripts/contextmenu.js Outdated Show resolved Hide resolved
src/webui/www/private/scripts/dynamicTable.js Outdated Show resolved Hide resolved
@Chocobo1 Chocobo1 added this to the 5.1 milestone Dec 6, 2024
Co-authored-by: Chocobo1 <Chocobo1@users.noreply.github.com>
@Chocobo1 Chocobo1 changed the title WebUI: Replace Mootools class list manipulation methods with classList equivalent WebUI: Replace Mootools class list manipulation methods Dec 8, 2024
@Chocobo1 Chocobo1 merged commit 7080f85 into qbittorrent:master Dec 8, 2024
14 checks passed
@Chocobo1
Copy link
Member

Chocobo1 commented Dec 8, 2024

@skomerko
Thank you!

$("decreaseQueuePosItem").classList.add("invisible");
$("bottomQueuePosItem").classList.add("invisible");
$("queueingButtons").classList.add("invisible");
$("queueingMenuItems").classList.add("invisible");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we could also use toggle with force here and get ride of the if/else, example:

$("topQueuePosItem").classList.toggle("invisible", !queueing_enabled);

it means, if queueing_enabled is true it removes, otherwise it adds.
just a suggestion to reduce a little if/else and code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WebUI WebUI-related issues/changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants