Extract reordering logic from core as optional plugin
Closed this issue · 11 comments
IMO this is a non-core feature and doesn't need to bloat the core library. Happy to be proven wrong if people think otherwise :)
@etiennesegonzac is re-ordering the same as 'edit-mode'?
currently yes. but we might end up with
list -> list with edit (selection) mode -> list with reordering
I'm still thinking selection could be handled purely on user side, but I might be overlooking things.
It depends of how much internal access will be needed to do a nicely scheduled transition I guess, we'll see!
You mean moving from selected -> unselected should go through scheduler?
oh no :)
I mean the transition where all the checkboxes/reordering tips appears.
Might be a non-issue (because of the small dom) but current gaia apps struggle with this.
I'm thinking:
- User changes some state somewhere in their app
- They call
list.render()
- This shedules a mutate task
- This triggers their render method which draws a checkbox
The above should ensure that the user never directly touches the DOM
Their render method might look something like:
render: function(el, data, index) {
el.classList.toggle('select-mode', appSelectModeFlag);
...
}
Closing as a dupe of #17
Fixed by 0948d0e