-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.resize_widget produces a wrong collision model #32
Comments
It's possible this commit 9402f20 fixes your problem? If not, let me know! Thanks! |
Hi vieron, thanks for your reply. Is this wrong behavior reproducible for you? or I'm the only one with this problem? |
Hi zambadu, I'm experiencing the exact same problem. After calling resize_widget there is some overlapping between the element that was resized and its neighbors. I will try to work on a solution for that... Please keep us posted on it. |
I'm having the same problem. Commit 9402f20 fixes the drop zone/drop preview. When resizing the height of a widget I have no problem. But something happens when I resize the width.
|
I'm also experiencing issues when dragging after resizing a widget (tested with changing height and width in chrome and ff). The overlapping issue still exists and widgets are not always placed as expected. |
+1 |
+1 Is there a fix for this? |
I think I may have stumbled upon a "fix" for this. Open jquery.gridster.js... Go to the resize_widget function definition. At the end of the function, you will see "return $widget" (this appears on line 1017). I've inserted "this.init();" right above the line where it returns $widget (inserted on line 1016) and this seems to have solved the problem for me. Can someone else verify that this does or does not work for them? |
tried it from the outside. |
raanmanraz - Just use the resize_widget function from the outside as normal (without calling widget.init() from the outside). If you drag elements around after you've implemented that one line of code, your widgets will cease to overlap and the collision class will be working as expected. |
Works like magic!! Thanks!! |
TaiD's fix NEEDS to be put into this, it works perfectly and fixes this problem just perfectly. |
I think I have a better fix which doesn't slow things down as much. inside of fn.add_faux_cols , find the following line: add this line directly BELOW it: inside of fn.generate_grid_and_stylesheet , find the following line: add this line directly BELOW it: inside of fn.resize_widget , find the following line: add this line directly ABOVE it: This combination seems to have fixed my issue and should resolve this issue as well. |
TalD's line: 1017 fix worked for me. Thanks! |
Bompus' suggestion worked for me. Thanks! |
bompus' patch works for me too. |
bompus' patch did not work for me but the TalD's this.init did... i dont notice slowness yet. |
TalD's patch works for me, I haven't tested bompus's patch. Anyway, the good thing here is that we can just do grid.init after grid.resize_widget so we don't have to actually patch the code. |
Thank You, saved me 👍 |
Shouldn't the bompus's patch be included on the original source? |
Seen on Chrome & Firefox (both latest).
If I use the .resize_widget function, the widget resizes as expected, but after that the collision model doesn't fit the cols and rows anymore, it seems to have doubled margin around the box, but only for the resized box. The others are still intact, but may produce overlays now and also ignore the box margins, if they have to push the resized box. This appears only on changing the cols. If changing the rows the collision model just doesn't resize, but still works correct.
Also the Preview Container is not scaled to the new size in both directions. It still have the origin size.
The text was updated successfully, but these errors were encountered: