ducksboard / gridster.js

gridster.js is a jQuery plugin that makes building intuitive draggable layouts from elements spanning multiple columns
http://gridster.net/
MIT License
6.03k stars 1.2k forks source link

Gridster items don't move after resize_widget() #364

Closed Superdrac closed 10 years ago

Superdrac commented 10 years ago

Hi, i made a mod which allow blocks to fit to their content but i have an issue with the moves...

When i call resize_widget() it's ok, my widget is resized, but when i drag another widget above or bellow, the widget that i just resize don't move and the widget that i drag can be put over...

It's like the widget that i resized was not a gridster object anymore. For it is again able to move like a gridster object, i need to drag it (not necessary on another grid box) but just a little, and it move again when another widget come above or below.

There is any solutions to this problem ?

Here, the item bellow the widget dragged must move (there is enough space on the right) 1grid

When i drop it goes behind the hovered widget. 2grid

And when i move it juste a little, it's movable again. 3grid

Superdrac commented 10 years ago

Ok, problem solved. For the resizing, i used a mix of jquery resizable() & resize_widget() (it allow me to add some contraints to it) and the resizable() jquery function add some inline styles to the resized item, i just needed to delete them via removeAttr() and it work fine !

Thx for your great tool.

otisg commented 10 years ago

@Superdrac Should this issue be closed or did you have to modify something that you plan on sharing?

Superdrac commented 10 years ago

@otisg This issue can be closed. Thank you!