Skip to content

Commit 03c986d

Browse files
Fixed minRow and maxRow
1 parent d52cc93 commit 03c986d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/gridstack.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,12 @@
693693

694694
opts = opts || {};
695695

696+
// if row property exists, replace minRow and maxRow
697+
if (opts.row) {
698+
opts.minRow = opts.row;
699+
opts.maxRow = opts.row;
700+
}
701+
696702
this.$el = $(el); // TODO: legacy code
697703
this.el = this.$el.get(0); // exposed HTML element to the user
698704

@@ -711,8 +717,8 @@
711717
this.opts = Utils.defaults(opts, {
712718
row: parseInt(this.$el.attr('data-gs-row')) || 0,
713719
column: parseInt(this.$el.attr('data-gs-column')) || 12,
714-
minRow: opts.row || parseInt(this.$el.attr('data-gs-row')) ? opts.row || parseInt(this.$el.attr('data-gs-row')) : parseInt(this.$el.attr('data-gs-min-row')) || 0,
715-
maxRow: opts.row || parseInt(this.$el.attr('data-gs-row')) ? opts.row || parseInt(this.$el.attr('data-gs-row')) : parseInt(this.$el.attr('data-gs-max-row')) || 0,
720+
minRow: parseInt(this.$el.attr('data-gs-row')) ? parseInt(this.$el.attr('data-gs-row')) : parseInt(this.$el.attr('data-gs-min-row')) || 0,
721+
maxRow: parseInt(this.$el.attr('data-gs-row')) ? parseInt(this.$el.attr('data-gs-row')) : parseInt(this.$el.attr('data-gs-max-row')) || 0,
716722
itemClass: 'grid-stack-item',
717723
placeholderClass: 'grid-stack-placeholder',
718724
placeholderText: '',

0 commit comments

Comments
 (0)