rniemeyer / knockout-sortable

A Knockout.js binding to connect observableArrays with jQuery UI sortable functionality
MIT License
547 stars 128 forks source link

Make empty list visible on drag? #141

Closed gdalam closed 9 years ago

gdalam commented 9 years ago

I understand that the current workaround to being able to drop into an empty list is to set a minimum height/width to that lists container.

However, is it possible to make it so that the empty list is only "displayed" (min height/width set) when you're dragging an element over top of where that list should be? Essentially the min height and width would only be set when you drag an item over that area.

I ask because if you want a nice, tight list hierarchy the UI doesn't look all that great with the empty lists being shown.

rniemeyer commented 9 years ago

@gdalam - maybe you could add mouseover/mouseout events that add a class that contains the min-height. Perhaps something like: http://jsfiddle.net/rniemeyer/zLusyfcu/ . The fiddle includes a sample hoverClass binding to simplify adding/removing a class. I don't see anything else built into jQuery UI sortable to aid in this scenario. Hope this helps!