@@ -26,11 +26,11 @@ export class OverlayRef implements PortalHost {
2626 constructor (
2727 private _portalHost : PortalHost ,
2828 private _pane : HTMLElement ,
29- private _state : OverlayConfig ,
29+ private _config : OverlayConfig ,
3030 private _ngZone : NgZone ) {
3131
32- if ( _state . scrollStrategy ) {
33- _state . scrollStrategy . attach ( this ) ;
32+ if ( _config . scrollStrategy ) {
33+ _config . scrollStrategy . attach ( this ) ;
3434 }
3535 }
3636
@@ -47,33 +47,33 @@ export class OverlayRef implements PortalHost {
4747 attach ( portal : Portal < any > ) : any {
4848 let attachResult = this . _portalHost . attach ( portal ) ;
4949
50- if ( this . _state . positionStrategy ) {
51- this . _state . positionStrategy . attach ( this ) ;
50+ if ( this . _config . positionStrategy ) {
51+ this . _config . positionStrategy . attach ( this ) ;
5252 }
5353
54- // Update the pane element with the given state configuration.
54+ // Update the pane element with the given configuration.
5555 this . _updateStackingOrder ( ) ;
5656 this . updateSize ( ) ;
5757 this . updateDirection ( ) ;
5858 this . updatePosition ( ) ;
5959
60- if ( this . _state . scrollStrategy ) {
61- this . _state . scrollStrategy . enable ( ) ;
60+ if ( this . _config . scrollStrategy ) {
61+ this . _config . scrollStrategy . enable ( ) ;
6262 }
6363
6464 // Enable pointer events for the overlay pane element.
6565 this . _togglePointerEvents ( true ) ;
6666
67- if ( this . _state . hasBackdrop ) {
67+ if ( this . _config . hasBackdrop ) {
6868 this . _attachBackdrop ( ) ;
6969 }
7070
71- if ( this . _state . panelClass ) {
71+ if ( this . _config . panelClass ) {
7272 // We can't do a spread here, because IE doesn't support setting multiple classes.
73- if ( Array . isArray ( this . _state . panelClass ) ) {
74- this . _state . panelClass . forEach ( cls => this . _pane . classList . add ( cls ) ) ;
73+ if ( Array . isArray ( this . _config . panelClass ) ) {
74+ this . _config . panelClass . forEach ( cls => this . _pane . classList . add ( cls ) ) ;
7575 } else {
76- this . _pane . classList . add ( this . _state . panelClass ) ;
76+ this . _pane . classList . add ( this . _config . panelClass ) ;
7777 }
7878 }
7979
@@ -95,8 +95,8 @@ export class OverlayRef implements PortalHost {
9595 // pointer events therefore. Depends on the position strategy and the applied pane boundaries.
9696 this . _togglePointerEvents ( false ) ;
9797
98- if ( this . _state . scrollStrategy ) {
99- this . _state . scrollStrategy . disable ( ) ;
98+ if ( this . _config . scrollStrategy ) {
99+ this . _config . scrollStrategy . disable ( ) ;
100100 }
101101
102102 let detachmentResult = this . _portalHost . detach ( ) ;
@@ -111,12 +111,12 @@ export class OverlayRef implements PortalHost {
111111 * Cleans up the overlay from the DOM.
112112 */
113113 dispose ( ) : void {
114- if ( this . _state . positionStrategy ) {
115- this . _state . positionStrategy . dispose ( ) ;
114+ if ( this . _config . positionStrategy ) {
115+ this . _config . positionStrategy . dispose ( ) ;
116116 }
117117
118- if ( this . _state . scrollStrategy ) {
119- this . _state . scrollStrategy . disable ( ) ;
118+ if ( this . _config . scrollStrategy ) {
119+ this . _config . scrollStrategy . disable ( ) ;
120120 }
121121
122122 this . detachBackdrop ( ) ;
@@ -152,48 +152,48 @@ export class OverlayRef implements PortalHost {
152152 }
153153
154154 /**
155- * Gets the current state config of the overlay.
155+ * Gets the current config of the overlay.
156156 */
157- getState ( ) : OverlayConfig {
158- return this . _state ;
157+ getConfig ( ) : OverlayConfig {
158+ return this . _config ;
159159 }
160160
161161 /** Updates the position of the overlay based on the position strategy. */
162162 updatePosition ( ) {
163- if ( this . _state . positionStrategy ) {
164- this . _state . positionStrategy . apply ( ) ;
163+ if ( this . _config . positionStrategy ) {
164+ this . _config . positionStrategy . apply ( ) ;
165165 }
166166 }
167167
168168 /** Updates the text direction of the overlay panel. */
169169 private updateDirection ( ) {
170- this . _pane . setAttribute ( 'dir' , this . _state . direction ! ) ;
170+ this . _pane . setAttribute ( 'dir' , this . _config . direction ! ) ;
171171 }
172172
173173 /** Updates the size of the overlay based on the overlay config. */
174174 updateSize ( ) {
175- if ( this . _state . width || this . _state . width === 0 ) {
176- this . _pane . style . width = formatCssUnit ( this . _state . width ) ;
175+ if ( this . _config . width || this . _config . width === 0 ) {
176+ this . _pane . style . width = formatCssUnit ( this . _config . width ) ;
177177 }
178178
179- if ( this . _state . height || this . _state . height === 0 ) {
180- this . _pane . style . height = formatCssUnit ( this . _state . height ) ;
179+ if ( this . _config . height || this . _config . height === 0 ) {
180+ this . _pane . style . height = formatCssUnit ( this . _config . height ) ;
181181 }
182182
183- if ( this . _state . minWidth || this . _state . minWidth === 0 ) {
184- this . _pane . style . minWidth = formatCssUnit ( this . _state . minWidth ) ;
183+ if ( this . _config . minWidth || this . _config . minWidth === 0 ) {
184+ this . _pane . style . minWidth = formatCssUnit ( this . _config . minWidth ) ;
185185 }
186186
187- if ( this . _state . minHeight || this . _state . minHeight === 0 ) {
188- this . _pane . style . minHeight = formatCssUnit ( this . _state . minHeight ) ;
187+ if ( this . _config . minHeight || this . _config . minHeight === 0 ) {
188+ this . _pane . style . minHeight = formatCssUnit ( this . _config . minHeight ) ;
189189 }
190190
191- if ( this . _state . maxWidth || this . _state . maxWidth === 0 ) {
192- this . _pane . style . maxWidth = formatCssUnit ( this . _state . maxWidth ) ;
191+ if ( this . _config . maxWidth || this . _config . maxWidth === 0 ) {
192+ this . _pane . style . maxWidth = formatCssUnit ( this . _config . maxWidth ) ;
193193 }
194194
195- if ( this . _state . maxHeight || this . _state . maxHeight === 0 ) {
196- this . _pane . style . maxHeight = formatCssUnit ( this . _state . maxHeight ) ;
195+ if ( this . _config . maxHeight || this . _config . maxHeight === 0 ) {
196+ this . _pane . style . maxHeight = formatCssUnit ( this . _config . maxHeight ) ;
197197 }
198198 }
199199
@@ -207,8 +207,8 @@ export class OverlayRef implements PortalHost {
207207 this . _backdropElement = document . createElement ( 'div' ) ;
208208 this . _backdropElement . classList . add ( 'cdk-overlay-backdrop' ) ;
209209
210- if ( this . _state . backdropClass ) {
211- this . _backdropElement . classList . add ( this . _state . backdropClass ) ;
210+ if ( this . _config . backdropClass ) {
211+ this . _backdropElement . classList . add ( this . _config . backdropClass ) ;
212212 }
213213
214214 // Insert the backdrop before the pane in the DOM order,
@@ -261,8 +261,8 @@ export class OverlayRef implements PortalHost {
261261
262262 backdropToDetach . classList . remove ( 'cdk-overlay-backdrop-showing' ) ;
263263
264- if ( this . _state . backdropClass ) {
265- backdropToDetach . classList . remove ( this . _state . backdropClass ) ;
264+ if ( this . _config . backdropClass ) {
265+ backdropToDetach . classList . remove ( this . _config . backdropClass ) ;
266266 }
267267
268268 backdropToDetach . addEventListener ( 'transitionend' , finishDetach ) ;
0 commit comments