Skip to content

Commit

Permalink
fix(generated-styles): cleaning cached serializations properly
Browse files Browse the repository at this point in the history
  • Loading branch information
vieron committed Feb 11, 2014
1 parent e76eed7 commit f8b04f2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/jquery.gridster.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@
this.min_widget_height = (this.options.widget_margins[1] * 2) +
this.options.widget_base_dimensions[1];

this.generated_stylesheets = [];
this.$style_tags = $([]);

this.init();
Expand Down Expand Up @@ -2752,6 +2753,7 @@
return false;
}

this.generated_stylesheets.push(serialized_opts);
Gridster.generated_stylesheets.push(serialized_opts);

/* generate CSS styles for cols */
Expand Down Expand Up @@ -2819,7 +2821,14 @@
* @return {Object} Returns the instance of the Gridster class.
*/
fn.remove_style_tags = function() {
var all_styles = Gridster.generated_stylesheets;
var ins_styles = this.generated_stylesheets;

this.$style_tags.remove();

Gridster.generated_stylesheets = $.map(all_styles, function(s) {
if ($.inArray(s, ins_styles) === -1) { return s; }
});
};


Expand Down

0 comments on commit f8b04f2

Please sign in to comment.