gridster.js icon indicating copy to clipboard operation
gridster.js copied to clipboard

Gridster disable reset on resize.

Open kalzekdor opened this issue 6 years ago • 7 comments

The state of the drag enable/disable setting seems to get reset whenever resize_responsive_layout() is called. If you disable() gridster, then have the resize layout called it becomes enabled again, causing widgets to be movable again.

kalzekdor avatar Dec 20 '18 19:12 kalzekdor

Looks like the culprit is https://github.com/dsmorse/gridster.js/blob/7cf095da2c189bae4d7deae4886af4ba0437953e/src/jquery.gridster.js#L3815 in generate_stylesheet. The toggle_collapsed_grid method explicitly sets enabled/disabled flags, overwriting what was already set.

kalzekdor avatar Dec 20 '18 19:12 kalzekdor

I'm going to look into it, because it clearly it's a bug, but I need to check if it resets the flags on the method for an specific reason or it was an oversight.

While I'm checking the issue, please, let me know how are you provisioning the library, are you downloading the source? are you using npm? I'm curious about how are we distributing... thanks!

fixmycode avatar Dec 21 '18 05:12 fixmycode

We're loading from https://www.jsdelivr.com/package/npm/dsmorse-gridster, which builds from NPM.

kalzekdor avatar Dec 21 '18 18:12 kalzekdor

Is this issue going to be resolved? It is easily replicated on browser resize. We recently incorporated gridster into a custom Progress Kendo jQuery widget and encountered the same bug, which for us is a big deal.

DeadX07 avatar May 21 '19 19:05 DeadX07

Is this issue going to be resolved? It is easily replicated on browser resize. We recently incorporated gridster into a custom Progress Kendo jQuery widget and encountered the same bug, which for us is a big deal.

What I ended up doing was binding a callback to the window resize event that re-disables gridster if it's supposed to be disabled. Not sure if that'll work for your scenario, but it was an acceptable workaround for us.

kalzekdor avatar May 22 '19 03:05 kalzekdor

@kalzekdor hello , I've been using it recently.Can you leave a contact to communicate? thank you

Donxiaohao avatar May 28 '19 09:05 Donxiaohao

I also hit this issue, the window resize callback solution works, but it hope it core problem can be fixed soon.

cakidnyc avatar Jun 14 '19 13:06 cakidnyc