Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(resizer): check for undefined option instead of fallback #474

Merged
merged 1 commit into from
May 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/app/modules/angular-slickgrid/services/resizer.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export class ResizerService {

// calculate bottom padding
// if using pagination, we need to add the pagination height to this bottom padding
let bottomPadding = (autoResizeOptions && autoResizeOptions.bottomPadding) ? autoResizeOptions.bottomPadding : DATAGRID_BOTTOM_PADDING;
let bottomPadding = (autoResizeOptions && autoResizeOptions.bottomPadding !== undefined) ? autoResizeOptions.bottomPadding : DATAGRID_BOTTOM_PADDING;
if (bottomPadding && gridOptions.enablePagination) {
bottomPadding += DATAGRID_PAGINATION_HEIGHT;
}
Expand All @@ -122,9 +122,9 @@ export class ResizerService {
const availableHeight = gridHeight - gridOffsetTop - bottomPadding;
const availableWidth = this._gridContainerElm.width() || window.innerWidth || 0;
const maxHeight = autoResizeOptions && autoResizeOptions.maxHeight || undefined;
const minHeight = autoResizeOptions && autoResizeOptions.minHeight || DATAGRID_MIN_HEIGHT;
const minHeight = (autoResizeOptions && autoResizeOptions.minHeight !== undefined) ? autoResizeOptions.minHeight : DATAGRID_MIN_HEIGHT;
const maxWidth = autoResizeOptions && autoResizeOptions.maxWidth || undefined;
const minWidth = autoResizeOptions && autoResizeOptions.minWidth || DATAGRID_MIN_WIDTH;
const minWidth = (autoResizeOptions && autoResizeOptions.minWidth !== undefined) ? autoResizeOptions.minWidth : DATAGRID_MIN_WIDTH;

let newHeight = availableHeight;
let newWidth = (autoResizeOptions && autoResizeOptions.sidePadding) ? availableWidth - autoResizeOptions.sidePadding : availableWidth;
Expand Down
2 changes: 1 addition & 1 deletion test/cypress/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"author": "Ghislain B.",
"license": "MIT",
"devDependencies": {
"cypress": "^4.5.0",
"cypress": "^4.6.0",
"mocha": "^5.2.0",
"mochawesome": "^3.1.2",
"mochawesome-merge": "^1.0.7",
Expand Down