Commit dc09f19 1 parent 04868a3 commit dc09f19 Copy full SHA for dc09f19
File tree 1 file changed +6
-6
lines changed
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 3041
3041
* Destroy this gridster by removing any sign of its presence, making it easy to avoid memory leaks
3042
3042
*
3043
3043
* @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.
3045
3046
*/
3046
- fn . destroy = function ( ) {
3047
+ fn . destroy = function ( remove ) {
3048
+ this . $el . removeData ( 'gridster' ) ;
3049
+
3047
3050
// remove bound callback on window resize
3048
3051
$ ( window ) . unbind ( '.gridster' ) ;
3049
3052
3053
3056
3054
3057
this . remove_style_tags ( ) ;
3055
3058
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 ( ) ;
3060
3060
3061
3061
return this ;
3062
3062
} ;
You can’t perform that action at this time.
0 commit comments