Skip to content

Commit f8b04f2

Browse files
committed
fix(generated-styles): cleaning cached serializations properly
1 parent e76eed7 commit f8b04f2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/jquery.gridster.js

+9
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@
128128
this.min_widget_height = (this.options.widget_margins[1] * 2) +
129129
this.options.widget_base_dimensions[1];
130130

131+
this.generated_stylesheets = [];
131132
this.$style_tags = $([]);
132133

133134
this.init();
@@ -2752,6 +2753,7 @@
27522753
return false;
27532754
}
27542755

2756+
this.generated_stylesheets.push(serialized_opts);
27552757
Gridster.generated_stylesheets.push(serialized_opts);
27562758

27572759
/* generate CSS styles for cols */
@@ -2819,7 +2821,14 @@
28192821
* @return {Object} Returns the instance of the Gridster class.
28202822
*/
28212823
fn.remove_style_tags = function() {
2824+
var all_styles = Gridster.generated_stylesheets;
2825+
var ins_styles = this.generated_stylesheets;
2826+
28222827
this.$style_tags.remove();
2828+
2829+
Gridster.generated_stylesheets = $.map(all_styles, function(s) {
2830+
if ($.inArray(s, ins_styles) === -1) { return s; }
2831+
});
28232832
};
28242833

28252834

0 commit comments

Comments
 (0)