Skip to content

A bug about gridHeight caused by maxRows #99

@natee

Description

@natee

source code line 401.

console.log("realRows:",maxHeight,'maxRows:',this.maxRows);
this.gridHeight = Math.min(this.maxRows, maxHeight);

You set gridHeight with the 'min' math function,then,when you set the 'maxRows:1' in your 'gridsterOptions' ,the 'gridHeight' may always be 1.

source code line 544.

var updateHeight = function() {
    $elem.css('height', (gridster.gridHeight * gridster.curRowHeight) + gridster.margins[0] + 'px');
    $elem.css('height', (gridster.gridHeight * gridster.curRowHeight) + (gridster.outerMargin ? gridster.margins[0] : -gridster.margins[0]) + 'px');
};

here,the $elem's width may always be 'curRowHeight + margins'.

So I changed the line 401 code to:

this.gridHeight = this.maxRows - maxHeight > 0 ? Math.min(this.maxRows, maxHeight) : Math.max(this.maxRows, maxHeight);

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions