Skip to content

Commit b7a0652

Browse files
Update jquery.gridList.js
Related to request hootsuite#103 : do not add space at the end of grid when drag and drop is not activated.
1 parent 8329c29 commit b7a0652

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/jquery.gridList.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,13 +260,13 @@
260260
});
261261
}
262262
// Update the width of the entire grid container with enough room on the
263-
// right to allow dragging items to the end of the grid.
263+
// right to allow dragging items to the end of the grid (unless drag&drop is not active).
264264
if (this.options.direction === "horizontal") {
265265
this.$element.width(
266-
(this.gridList.grid.length + this._widestItem) * this._cellWidth);
266+
(this.gridList.grid.length + (this.options.dragAndDrop ? this._widestItem : 0)) * this._cellWidth);
267267
} else {
268268
this.$element.height(
269-
(this.gridList.grid.length + this._tallestItem) * this._cellHeight);
269+
(this.gridList.grid.length + (this.options.dragAndDrop ? this._tallestItem : 0)) * this._cellHeight);
270270
}
271271
},
272272

0 commit comments

Comments
 (0)