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

Add option to leave DOM in place when destroy() is called, add proper cleanup of generated_stylesheets. #296

Open billschaller opened 10 years ago

billschaller commented 10 years ago

Add the option suggested in #218 to allow clean destroy by running destroy(false). This allows you to use gridster on an element, and then destroy gridster without destroying the original DOM elements. This is what I'm using to cleanly implement window resizing at the moment.

Add some code to properly strip out generated style tags when destroying the gridster instance. It also removes the entries in the Gridster.generated_stylesheets static var. This should allow multiple gridster instances to play more nicely on the same page. This should take care of #284, #227, and is a more complete solution than #287.

ciaranj commented 10 years ago

:+1: This patch is spot on for adding + removing gridster from the same page repeatedly :)