File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed
Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change 3939 document . getElementsByTagName ( 'head' ) [ 0 ] . appendChild ( style ) ;
4040 return style . sheet ;
4141 } ,
42-
42+ remove_stylesheet : function ( id ) {
43+ $ ( "STYLE[data-gs-id=" + id + "]" ) . remove ( ) ;
44+ } ,
4345 insert_css_rule : function ( sheet , selector , rules , index ) {
4446 if ( typeof sheet . insertRule === 'function' ) {
4547 sheet . insertRule ( selector + '{' + rules + '}' , index ) ;
463465 this . grid . get_grid_height ( ) * ( this . opts . cell_height + this . opts . vertical_margin ) -
464466 this . opts . vertical_margin ) ;
465467
466- var on_resize_handler = function ( ) {
468+ this . on_resize_handler = function ( ) {
467469 if ( self . _is_one_column_mode ( ) ) {
468470 if ( one_column_mode )
469471 return ;
506508 }
507509 } ;
508510
509- $ ( window ) . resize ( on_resize_handler ) ;
510- on_resize_handler ( ) ;
511+ $ ( window ) . resize ( this . on_resize_handler ) ;
512+ this . on_resize_handler ( ) ;
511513 } ;
512514
513515 GridStack . prototype . _init_styles = function ( ) {
732734 this . _update_container_height ( ) ;
733735 } ;
734736
737+ GridStack . prototype . destroy = function ( ) {
738+ $ ( window ) . off ( "resize" , this . on_resize_handler ) ;
739+ this . disable ( ) ;
740+ this . container . remove ( ) ;
741+ Utils . remove_stylesheet ( this . _styles_id ) ;
742+ if ( this . grid )
743+ this . grid = null ;
744+ } ;
745+
735746 GridStack . prototype . resizable = function ( el , val ) {
736747 el = $ ( el ) ;
737748 el . each ( function ( index , el ) {
You can’t perform that action at this time.
0 commit comments