File tree Expand file tree Collapse file tree 2 files changed +22
-25
lines changed
cdk-experimental/column-resize
material-experimental/column-resize Expand file tree Collapse file tree 2 files changed +22
-25
lines changed Original file line number Diff line number Diff line change @@ -102,10 +102,29 @@ export abstract class Resizable<HandleComponent extends ResizeOverlayHandle>
102
102
103
103
protected abstract getInlineHandleCssClassName ( ) : string ;
104
104
105
- protected abstract createOverlayForHandle ( ) : OverlayRef ;
106
-
107
105
protected abstract getOverlayHandleComponentType ( ) : Type < HandleComponent > ;
108
106
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
+
109
128
private _listenForRowHoverEvents ( ) : void {
110
129
const element = this . elementRef . nativeElement ! ;
111
130
const takeUntilDestroyed = takeUntil < boolean > ( this . destroyed ) ;
@@ -115,7 +134,7 @@ export abstract class Resizable<HandleComponent extends ResizeOverlayHandle>
115
134
. pipe ( takeUntilDestroyed ) . subscribe ( hoveringRow => {
116
135
if ( hoveringRow ) {
117
136
if ( ! this . overlayRef ) {
118
- this . overlayRef = this . createOverlayForHandle ( ) ;
137
+ this . overlayRef = this . _createOverlayForHandle ( ) ;
119
138
}
120
139
121
140
this . _showHandleOverlay ( ) ;
Original file line number Diff line number Diff line change 7
7
*/
8
8
9
9
import { Directive , Type } from '@angular/core' ;
10
- import { OverlayRef } from '@angular/cdk/overlay' ;
11
10
import { Resizable } from '@angular/cdk-experimental/column-resize' ;
12
11
13
12
import { MatColumnResizeOverlayHandle } from './overlay-handle' ;
@@ -19,27 +18,6 @@ export abstract class AbstractMatResizable extends Resizable<MatColumnResizeOver
19
18
return 'mat-resizable-handle' ;
20
19
}
21
20
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
-
43
21
protected getOverlayHandleComponentType ( ) : Type < MatColumnResizeOverlayHandle > {
44
22
return MatColumnResizeOverlayHandle ;
45
23
}
You can’t perform that action at this time.
0 commit comments