Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c0c12d0

Browse files
committed
gridster/fix: calculating container_width correctly
Thanks @badtant for the notice (ducksboard@3d755fd#commitcomment-3423763)
1 parent 10ef102 commit c0c12d0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/jquery.gridster.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2549,8 +2549,10 @@
25492549
this.baseX = ($(window).width() - aw) / 2;
25502550
this.baseY = this.$wrapper.offset().top;
25512551

2552-
this.container_width = (this.cols * this.options.widget_base_dimensions[0]) +
2553-
(this.cols * this.options.widget_margins[0]) + this.options.widget_margins[0];
2552+
// left and right gutters not included
2553+
this.container_width = (this.cols *
2554+
this.options.widget_base_dimensions[0]) + ((this.cols - 1) * 2 *
2555+
this.options.widget_margins[0]);
25542556

25552557
if (this.options.autogenerate_stylesheet) {
25562558
this.generate_stylesheet();

0 commit comments

Comments
 (0)