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

Reorder chapters mode #2150

Merged
merged 3 commits into from
Sep 30, 2024
Merged

Reorder chapters mode #2150

merged 3 commits into from
Sep 30, 2024

Conversation

tf
Copy link
Member

@tf tf commented Sep 30, 2024

REDMINE-20837

Dragging large chapters is hard.

REDMINE-20837
Less buggy when it comes to sorting items within a scrolling
container.

SortableJS triggers callbacks in different order: `onRemove` is
invoked after `onAdd`. Since removing a model from a
`ForeignKeySubsetCollection` resets the parent reference, we have to
make sure to first remove and than add. Use the fact that - after
`onAdd` - `onSort` is called on both sortables when moving an item and
use it instead of `onRemove`.

SortableJS leaves the dragged element in place and only applies a CSS
class. Use this to simplify the placeholder setup.

REDMIME-20837
@tf tf added this to the v17.1 milestone Sep 30, 2024
@tf tf merged commit eadca28 into codevise:master Sep 30, 2024
13 checks passed
@tf tf deleted the reorder-chapters branch September 30, 2024 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant