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

Fix bugs with selectors #1164

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

UltimateEvil
Copy link

Both the happy.ts and checkboxes.ts had many bugs.

  1. No initialisation after ajax relaod
  2. No initialisation on page load - for counter
  3. features straight up not working
  • injected css via injecting the DOM
  • happy checkboxes
  • multirow selection
    ...
  1. no onchange events were ever invoked so one plugin would ruin the state of the other.
  2. global callbacks being registered multiple times

PeAd added 6 commits February 6, 2025 19:59
The old "hack" which injects it into the HTML raw fails on firefox.
…eplaces them with new ones. But this is never refreshed on reload, so only the css remains, while the checkboxes are never replaced.
…he actually inserted elements. I chose to, for the sake of least changes, only add the callback once globally.

Moreover, the happy-checkbox selector selects the new fancy checkbox, not the native checkbox like the code assumes.

Also swaps the order of operations so any callback bound on the native input which may want to change/check the state of the happy checkbox is in a consistent, new state.
… parry checkboxes can never be kep in sync with the native checkboxes.

This necessitated adding a check thet I am not changing the current element.

On reload checkbox callbacks were not initialised. Meaning the checkboxes could not do a second action after the first was invoked as it reloads the page and prevents checking.

All callbacks should only ever invoke the onChange on the native input as the happy inputs may not even exist. This prevents inifinite looping.

The counter should be initialised to 0/10 so the select count does not just appear out of nowhere.

The counter used to show the Total including the check all button if any button but the check all button was clicked.

Actually initialise the group action state at all times. Any javascript could run before this callback and this would ignore the checked boxes.

The multirow selection did ot work due to
1) no change events
2) the last checkbox being change at the start of the function rather than the end.
3) we were taking the lastCheckbox and lastCheckbox???
4) rowindex is global not only in this part of the table.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant