Skip to content

Commit 543b8fd

Browse files
committed
ready for draft PR!
1 parent 2feab3e commit 543b8fd

File tree

2 files changed

+22
-25
lines changed

2 files changed

+22
-25
lines changed

src/cdk-experimental/column-resize/resizable.ts

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,29 @@ export abstract class Resizable<HandleComponent extends ResizeOverlayHandle>
102102

103103
protected abstract getInlineHandleCssClassName(): string;
104104

105-
protected abstract createOverlayForHandle(): OverlayRef;
106-
107105
protected abstract getOverlayHandleComponentType(): Type<HandleComponent>;
108106

107+
private _createOverlayForHandle(): OverlayRef {
108+
const positionStrategy = this.overlay.position()
109+
.flexibleConnectedTo(this.elementRef.nativeElement!)
110+
.withFlexibleDimensions(false)
111+
.withGrowAfterOpen(false)
112+
.withPush(false)
113+
.withPositions([{
114+
originX: 'end',
115+
originY: 'top',
116+
overlayX: 'center',
117+
overlayY: 'top',
118+
}]);
119+
120+
return this.overlay.create({
121+
disposeOnNavigation: true,
122+
positionStrategy,
123+
scrollStrategy: this.overlay.scrollStrategies.reposition(),
124+
width: '16px',
125+
});
126+
}
127+
109128
private _listenForRowHoverEvents(): void {
110129
const element = this.elementRef.nativeElement!;
111130
const takeUntilDestroyed = takeUntil<boolean>(this.destroyed);
@@ -115,7 +134,7 @@ export abstract class Resizable<HandleComponent extends ResizeOverlayHandle>
115134
.pipe(takeUntilDestroyed).subscribe(hoveringRow => {
116135
if (hoveringRow) {
117136
if (!this.overlayRef) {
118-
this.overlayRef = this.createOverlayForHandle();
137+
this.overlayRef = this._createOverlayForHandle();
119138
}
120139

121140
this._showHandleOverlay();

src/material-experimental/column-resize/resizable.ts

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
*/
88

99
import {Directive, Type} from '@angular/core';
10-
import {OverlayRef} from '@angular/cdk/overlay';
1110
import {Resizable} from '@angular/cdk-experimental/column-resize';
1211

1312
import {MatColumnResizeOverlayHandle} from './overlay-handle';
@@ -19,27 +18,6 @@ export abstract class AbstractMatResizable extends Resizable<MatColumnResizeOver
1918
return 'mat-resizable-handle';
2019
}
2120

22-
protected createOverlayForHandle(): OverlayRef {
23-
const positionStrategy = this.overlay.position()
24-
.flexibleConnectedTo(this.elementRef.nativeElement!)
25-
.withFlexibleDimensions(false)
26-
.withGrowAfterOpen(false)
27-
.withPush(false)
28-
.withPositions([{
29-
originX: 'end',
30-
originY: 'top',
31-
overlayX: 'center',
32-
overlayY: 'top',
33-
}]);
34-
35-
return this.overlay.create({
36-
disposeOnNavigation: true,
37-
positionStrategy,
38-
scrollStrategy: this.overlay.scrollStrategies.reposition(),
39-
width: '16px',
40-
});
41-
}
42-
4321
protected getOverlayHandleComponentType(): Type<MatColumnResizeOverlayHandle> {
4422
return MatColumnResizeOverlayHandle;
4523
}

0 commit comments

Comments
 (0)