Skip to content

Commit 9732b01

Browse files
author
David Morse
committed
Merge commit 'e69c3e8f64aa4557ef032e4d0d8185e83b1aed21'
fix(gridster): responsive width now resizes based off wrapper not window
2 parents 8473bd6 + e69c3e8 commit 9732b01

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/jquery.gridster.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3723,13 +3723,14 @@
37233723

37243724
for (var y = 1; y <= opts.rows; y++) {
37253725
styles += (opts.namespace + ' [data-sizey="' + y + '"] { height:' +
3726-
(full_width ? 'auto' : ((y * opts.widget_base_dimensions[1]) + ((y - 1) * opts.widget_margins[1]))) + 'px; }\n');
3726+
(full_width ? 'auto' : ((y * opts.widget_base_dimensions[1]) + ((y - 1) * opts.widget_margins[1]))) + (full_width ? '' : 'px') + '; }\n');
3727+
37273728
}
37283729

37293730
for (var x = 1; x <= opts.cols; x++) {
37303731
styles += (opts.namespace + ' [data-sizex="' + x + '"] { width:' +
3731-
(full_width ? ($(window).width() - this.options.widget_margins[0] * 2) :
3732-
((x * opts.widget_base_dimensions[0]) + ((x - 1) * opts.widget_margins[0]))) + 'px; }\n');
3732+
(full_width ? (this.$wrapper.width() - this.options.widget_margins[0] * 2) : ((x * opts.widget_base_dimensions[0]) + ((x - 1) * opts.widget_margins[0]))) + 'px; }\n');
3733+
37333734
}
37343735

37353736
this.remove_style_tags();

0 commit comments

Comments
 (0)