diff --git a/src/jquery.gridster.js b/src/jquery.gridster.js index 3de1ae793..58a5a6817 100755 --- a/src/jquery.gridster.js +++ b/src/jquery.gridster.js @@ -3723,13 +3723,14 @@ for (var y = 1; y <= opts.rows; y++) { styles += (opts.namespace + ' [data-sizey="' + y + '"] { height:' + - (full_width ? 'auto' : ((y * opts.widget_base_dimensions[1]) + ((y - 1) * opts.widget_margins[1]))) + 'px; }\n'); + (full_width ? 'auto' : ((y * opts.widget_base_dimensions[1]) + ((y - 1) * opts.widget_margins[1]))) + (full_width ? '' : 'px') + '; }\n'); + } for (var x = 1; x <= opts.cols; x++) { styles += (opts.namespace + ' [data-sizex="' + x + '"] { width:' + - (full_width ? ($(window).width() - this.options.widget_margins[0] * 2) : - ((x * opts.widget_base_dimensions[0]) + ((x - 1) * opts.widget_margins[0]))) + 'px; }\n'); + (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'); + } this.remove_style_tags();