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

refactor: Apply change pResizableColumnDisabled #4

Merged
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
27 changes: 26 additions & 1 deletion src/app/components/table/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3933,7 +3933,7 @@ export class RowToggler {
}
})
export class ResizableColumn implements AfterViewInit, OnDestroy {
@Input({ transform: booleanAttribute }) pResizableColumnDisabled: boolean | undefined;
_pResizableColumnDisabled: boolean | undefined;

resizer: HTMLSpanElement | undefined;

Expand All @@ -3949,6 +3949,31 @@ export class ResizableColumn implements AfterViewInit, OnDestroy {

documentMouseUpListener: VoidListener;

@Input({ transform: booleanAttribute })
set pResizableColumnDisabled(pResizableColumnDisabled: boolean | undefined) {
if (pResizableColumnDisabled === this._pResizableColumnDisabled) return;

this._pResizableColumnDisabled = pResizableColumnDisabled;
if (isPlatformBrowser(this.platformId) && this.isEnabled())
this.ngAfterViewInit();
else if (this.resizer) {
this.renderer.removeChild(this.el.nativeElement, this.resizer);
if (this.resizerMouseDownListener) {
this.resizerMouseDownListener();
this.resizerMouseDownListener = null;
}

if (this.resizerTouchStartListener) {
this.resizerTouchStartListener();
this.resizerTouchStartListener = null;
}
}
};

get pResizableColumnDisabled() {
return this._pResizableColumnDisabled;
}

constructor(@Inject(DOCUMENT) private document: Document, @Inject(PLATFORM_ID) private platformId: any, private renderer: Renderer2, public dt: Table, public el: ElementRef, public zone: NgZone) {}

ngAfterViewInit() {
Expand Down
Loading