Skip to content

Commit f513793

Browse files
author
Zach Liss
committed
fix(fn.generate_stylesheet): only return new stylesheet if colWidth and
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.
1 parent a7ed9a4 commit f513793

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

dist/jquery.gridster.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -4707,7 +4707,8 @@
47074707

47084708
this.remove_style_tags();
47094709

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

47134714

0 commit comments

Comments
 (0)