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

Widgets not re-arranged correctly after resize_widget #262

Closed mtruneck closed 5 years ago

mtruneck commented 10 years ago

I wanted to make minimalisation function in gridster, but the resize_widget probably breaks something...

I tried to isolate the problem in this jsFiddle: http://jsfiddle.net/Q2KB6/

When you click on "up" text on the left upper widget and then again click on "down", the widget below this one will goo far far down.

I use Firefox 24 and gridster 0.2.1

mtruneck commented 10 years ago

I finally managed to found the issue. The thing is that I parsed the new size from element attributes which caused that the type of the variable was string instead of number. Then, (1 + 5) was not 6 but 15, which explained a lot.

Although this is obviously my fault, I suggest adding variable type checks to the beginning of functions.