File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 30413041 * Destroy this gridster by removing any sign of its presence, making it easy to avoid memory leaks
30423042 *
30433043 * @method destroy
3044- * @return {undefined }
3044+ * @param {Boolean } remove If true, remove gridster from DOM.
3045+ * @return {Object } Returns the instance of the Gridster class.
30453046 */
3046- fn . destroy = function ( ) {
3047+ fn . destroy = function ( remove ) {
3048+ this . $el . removeData ( 'gridster' ) ;
3049+
30473050 // remove bound callback on window resize
30483051 $ ( window ) . unbind ( '.gridster' ) ;
30493052
30533056
30543057 this . remove_style_tags ( ) ;
30553058
3056- // lastly, remove gridster element
3057- // this will additionally cause any data associated to this element to be removed, including this
3058- // very gridster instance
3059- this . $el . remove ( ) ;
3059+ remove && this . $el . remove ( ) ;
30603060
30613061 return this ;
30623062 } ;
You can’t perform that action at this time.
0 commit comments