lukaskleinschmidt/kirby-sortable

Drag axis

iskrisis opened this issue · 3 comments

Just question, in the settings of jquery ui sortable
https://github.com/lukaskleinschmidt/kirby-sortable/blob/master/fields/sortable/assets/js/sortable.js#L11-L12

is there reason there is no axis: 'y' ? I mean it might be little aesthetic nuance, but i end up changing it in the plugin all the time. For the sortable usecase i think you don't want "module blocks" to move everywhere.

Actually I was not aware of that option. The goal was to be as close to the native drag and drop behaviour kirby ships with (subpage ordering, structure field …).
I will not change the default behaviour because I have a connected sortable fields feature in the pipeline that will need this behaviour.

Perhaps I add a config somewhere to modify the js initiation. But honestly I'm not sure about that. I will have a closer look at this when I find the time.

Its true that its kirbys default for draggalbe behavior. Maybe i should also post i there.

Paradox is that if you are working on some kind of "nesting" of modules, then this might actually be prefered behavior but in kirby default fields its not needed.

But i guess its just details.

Yeah it's hard to get it right for everyone 😉
But the small details are often the ones that bug one the most.
Have you considered creating a customized field? You could easily add any additions or changes there so you don't have to do it in the plugin core.