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

Multi-instance: Drag events delivered to wrong instance (with reproducing code) #272

Closed febeling closed 10 years ago

febeling commented 10 years ago

When using multiple Gridster instances on the same page, the drag events start and stop are being delivered to a wrong instance. Apparently the last one receives the events.

I reproduced the problem in the Multi-instance demo page. See febeling@a30551d66547501ffec435421c29f0f38c0ba05f and febeling@79d0feddb754e2ea63e6f57ce69a6f2a6cdce1ed.

If you drag in first grid, the console log message says "grid 2".

myabc commented 10 years ago

@febeling Problem was with Gridster options handling (and default options being modified with values of first instance).

The following patch should remediate the problem: https://github.com/myabc/gridster.js/commit/f911c2eebbdb43f1e55edd3f08384d5d80d0ebee

febeling commented 10 years ago

I can confirm that PR #273 fixes the problem.

febeling commented 10 years ago

Fixed with #273, which has been merged.