Fix enabled status of up/down/top/bottom buttons on move item up/down #165
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I don't see an open issue for this, but it seems like the logic to {en,dis}able the move buttons is not correct when items are moved up/down (it is correct on move to top/bottom as this causes a page refresh). This PR fixes the button status on both newly moved items and simplifies the overall logic a bit.
Notably - I'm not really great with web languages in general, but my best guess for why this was broken is that the
querySelector
fortbody
was first matching the table for user-provided attributes (ex. shoe size, shirt size, etc.). So my changes for the enable/disable logic itself may not be fully necessary.Closes #168 and probably closes #152