File tree 1 file changed +15
-4
lines changed
1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change 39
39
document . getElementsByTagName ( 'head' ) [ 0 ] . appendChild ( style ) ;
40
40
return style . sheet ;
41
41
} ,
42
-
42
+ remove_stylesheet : function ( id ) {
43
+ $ ( "STYLE[data-gs-id=" + id + "]" ) . remove ( ) ;
44
+ } ,
43
45
insert_css_rule : function ( sheet , selector , rules , index ) {
44
46
if ( typeof sheet . insertRule === 'function' ) {
45
47
sheet . insertRule ( selector + '{' + rules + '}' , index ) ;
463
465
this . grid . get_grid_height ( ) * ( this . opts . cell_height + this . opts . vertical_margin ) -
464
466
this . opts . vertical_margin ) ;
465
467
466
- var on_resize_handler = function ( ) {
468
+ this . on_resize_handler = function ( ) {
467
469
if ( self . _is_one_column_mode ( ) ) {
468
470
if ( one_column_mode )
469
471
return ;
506
508
}
507
509
} ;
508
510
509
- $ ( window ) . resize ( on_resize_handler ) ;
510
- on_resize_handler ( ) ;
511
+ $ ( window ) . resize ( this . on_resize_handler ) ;
512
+ this . on_resize_handler ( ) ;
511
513
} ;
512
514
513
515
GridStack . prototype . _init_styles = function ( ) {
732
734
this . _update_container_height ( ) ;
733
735
} ;
734
736
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
+
735
746
GridStack . prototype . resizable = function ( el , val ) {
736
747
el = $ ( el ) ;
737
748
el . each ( function ( index , el ) {
You can’t perform that action at this time.
0 commit comments