From 2898201b321b67d747aca0c01591e9ad672fb10d Mon Sep 17 00:00:00 2001 From: "Ronald A. Richardson" Date: Thu, 9 Nov 2023 12:05:19 +0800 Subject: [PATCH] fix typo on Point cell callbacks --- addon/components/drawer.js | 6 ++---- addon/components/table/cell/point.js | 17 ++++++++++------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/addon/components/drawer.js b/addon/components/drawer.js index c6cf51b..12076e2 100644 --- a/addon/components/drawer.js +++ b/addon/components/drawer.js @@ -125,21 +125,19 @@ export default class DrawerComponent extends Component { return; } - const dx = event.clientX - this.mouseX; const dy = event.clientY - this.mouseY; const multiplier = -1; - const width = dx * multiplier + this.overlayWidth; const height = dy * multiplier + this.overlayHeight; const minResizeHeight = getWithDefault(this.args, 'minResizeHeight', 0); const maxResizeHeight = getWithDefault(this.args, 'maxResizeHeight', 600); - // Min resize width + // Min resize height if (height <= minResizeHeight) { drawerPanelNode.style.height = `${minResizeHeight}px`; return; } - // Max resize width + // Max resize height if (height >= maxResizeHeight) { drawerPanelNode.style.height = `${maxResizeHeight}px`; return; diff --git a/addon/components/table/cell/point.js b/addon/components/table/cell/point.js index f39829a..9921d8e 100644 --- a/addon/components/table/cell/point.js +++ b/addon/components/table/cell/point.js @@ -37,15 +37,18 @@ export default class TableCellPointComponent extends Component { } @action onClick() { - const { column } = this.args; - const { onClick, action } = column; + const column = this.args.column; - if (typeof onClick === 'funciton') { - onClick(this.args.row, ...arguments); - } + if (column) { + const { onClick, action } = column; + + if (typeof onClick === 'function') { + onClick(this.args.row, ...arguments); + } - if (typeof action === 'funciton') { - action(this.args.row); + if (typeof action === 'function') { + action(this.args.row); + } } } }