From f1e757e5a792792f30fb494a1c08af0a59f4a0ec Mon Sep 17 00:00:00 2001 From: chinons098 Date: Sun, 13 Oct 2024 21:21:48 -0400 Subject: [PATCH] code clean-up for table colum resize --- .../taskmanager.column-resize.directive.ts | 30 ------------------- 1 file changed, 30 deletions(-) diff --git a/src/app/system-apps/taskmanager/taskmanager.column-resize.directive.ts b/src/app/system-apps/taskmanager/taskmanager.column-resize.directive.ts index e0281cd..2e779f1 100644 --- a/src/app/system-apps/taskmanager/taskmanager.column-resize.directive.ts +++ b/src/app/system-apps/taskmanager/taskmanager.column-resize.directive.ts @@ -1,5 +1,3 @@ -// column-resize.directive.ts - import { Directive, ElementRef, HostListener, Renderer2 } from '@angular/core'; @Directive({ @@ -57,37 +55,9 @@ export class ColumnResizeDirective { cells[this.columnIndex].style.width = `${newWidth}px`; } }); - - // Adjust the width of the table if it has a fixed width - // const tableWidth = this.table?.offsetWidth || 0; - // if (tableWidth > 0) { - // this.renderer.setStyle(this.table, 'width', tableWidth + deltaX + 'px'); - // } } }; - - - // const onMouseMove1 = (moveEvent: MouseEvent) => { - // if (this.isResizing) { - - // const deltaX = moveEvent.pageX - this.startX; - // const newWidth = this.initialWidth + deltaX; - - // let width = 0; - // let right = 0; - // const thElmnt = this.el.nativeElement.closest("th")?.getBoundingClientRect(); - // width = thElmnt.width; - // right = thElmnt.right; - - // const newWidth1 = width + moveEvent.clientX - right; - // const tableWidth = this.table?.offsetWidth || 0; - // console.log('table width:',tableWidth); - // // this.renderer.setStyle(this.table, 'width', tableWidth + deltaX + 'px'); - // this.renderer.setStyle(this.el.nativeElement, 'width', `${newWidth}px`); - // } - // }; - const onMouseUp = () => { this.isResizing = false; this.renderer.removeClass(this.el.nativeElement, 'resizing');