From 79fc444e395d892aa980465034f72a9ae72b48a0 Mon Sep 17 00:00:00 2001 From: Bill Schaller Date: Mon, 18 May 2015 13:32:43 -0400 Subject: [PATCH] Fix grid calculations when wrapper/gridster element is not centered --- src/jquery.gridster.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/jquery.gridster.js b/src/jquery.gridster.js index f2511f50a..78b4373aa 100755 --- a/src/jquery.gridster.js +++ b/src/jquery.gridster.js @@ -3956,6 +3956,10 @@ this.baseX = ($window.width() - aw) / 2; this.baseY = this.$wrapper.offset().top; + if (this.$wrapper.css('position') == 'relative') { + this.baseX = this.baseY = 0; + } + $.each(this.faux_grid, $.proxy(function (i, coords) { this.faux_grid[i] = coords.update({ left: this.baseX + (coords.data.col - 1) * this.min_widget_width,