Skip to content

Commit

Permalink
fix(fn.generate_stylesheet): only return new stylesheet if colWidth and
Browse files Browse the repository at this point in the history
this.$wrapper.width() are > 0

With reponsive layouts, on window resize, colWidth and
this.$wrapper.width() can be <= 0. This causes widget widths to be set
as <= 0. I think it is fair to assume that both the colWidth and
$wrapper.width() must be greater than 0 in order to generate a valid
stylesheet.
  • Loading branch information
Zach Liss committed Nov 18, 2015
1 parent a7ed9a4 commit f513793
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dist/jquery.gridster.js
Original file line number Diff line number Diff line change
Expand Up @@ -4707,7 +4707,8 @@

this.remove_style_tags();

return this.add_style_tag(styles);
/* only add_style_tag if the colWidth and $wrapper.width() are greater than 0 */
return (colWidth <= 0 || this.$wrapper.width() <= 0) ? this : this.add_style_tag(styles);
};


Expand Down

0 comments on commit f513793

Please sign in to comment.