Skip to content

Commit

Permalink
fix(resizer): check for undefined option instead of fallback (#474)
Browse files Browse the repository at this point in the history
Co-authored-by: Ghislain Beaulac <ghislain.beaulac@se.com>
  • Loading branch information
ghiscoding and ghiscoding-SE committed May 26, 2020
1 parent 10f0b7d commit 59975f0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
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

0 comments on commit 59975f0

Please sign in to comment.