@@ -20,7 +20,8 @@ import {
20
20
animate ,
21
21
transition ,
22
22
AnimationTransitionEvent ,
23
- ElementRef , Renderer ,
23
+ ElementRef ,
24
+ Renderer ,
24
25
} from '@angular/core' ;
25
26
import { CommonModule } from '@angular/common' ;
26
27
import {
@@ -30,14 +31,14 @@ import {
30
31
LEFT_ARROW ,
31
32
ENTER ,
32
33
coerceBooleanProperty ,
34
+ PortalHostDirective ,
33
35
} from '../core' ;
34
36
import { MdTabLabel } from './tab-label' ;
35
37
import { MdTabLabelWrapper } from './tab-label-wrapper' ;
36
38
import { MdTabNavBar , MdTabLink } from './tab-nav-bar/tab-nav-bar' ;
37
39
import { MdInkBar } from './ink-bar' ;
38
40
import { Observable } from 'rxjs/Observable' ;
39
41
import 'rxjs/add/operator/map' ;
40
- import { PortalHostDirective } from '../core/portal/portal-directives' ;
41
42
42
43
43
44
/** Used to generate unique ID's for each tab component */
@@ -273,7 +274,7 @@ export class MdTabGroup {
273
274
* Sets the height of the body wrapper to the height of the activating tab if dynamic
274
275
* height property is true.
275
276
*/
276
- _setTabBodyWrapperHeight ( e : number ) {
277
+ _setTabBodyWrapperHeight ( tabHeight : number ) : void {
277
278
if ( ! this . _dynamicHeight ) { return ; }
278
279
279
280
this . _renderer . setElementStyle ( this . _tabBodyWrapper . nativeElement , 'height' ,
@@ -282,12 +283,13 @@ export class MdTabGroup {
282
283
// This conditional forces the browser to paint the height so that
283
284
// the animation to the new height can have an origin.
284
285
if ( this . _tabBodyWrapper . nativeElement . offsetHeight ) {
285
- this . _renderer . setElementStyle ( this . _tabBodyWrapper . nativeElement , 'height' , e + 'px' ) ;
286
+ this . _renderer . setElementStyle ( this . _tabBodyWrapper . nativeElement , 'height' ,
287
+ tabHeight + 'px' ) ;
286
288
}
287
289
}
288
290
289
291
/** Removes the height of the tab body wrapper. */
290
- _removeTabBodyWrapperHeight ( ) {
292
+ _removeTabBodyWrapperHeight ( ) : void {
291
293
this . _renderer . setElementStyle ( this . _tabBodyWrapper . nativeElement , 'height' , '' ) ;
292
294
}
293
295
}
@@ -299,7 +301,7 @@ export type MdTabBodyActiveState = 'left' | 'center' | 'right';
299
301
selector : 'md-tab-body' ,
300
302
templateUrl : 'tab-body.html' ,
301
303
animations : [
302
- trigger ( 'position ' , [
304
+ trigger ( 'translateTab ' , [
303
305
state ( 'left' , style ( { transform : 'translate3d(-100%, 0, 0)' } ) ) ,
304
306
state ( 'center' , style ( { transform : 'translate3d(0, 0, 0)' } ) ) ,
305
307
state ( 'right' , style ( { transform : 'translate3d(100%, 0, 0)' } ) ) ,
@@ -342,13 +344,13 @@ export class MdTabBody implements OnInit {
342
344
}
343
345
}
344
346
345
- _onAnimationStarted ( e : AnimationTransitionEvent ) {
347
+ _onTranslateTabStarted ( e : AnimationTransitionEvent ) {
346
348
if ( e . fromState != 'void' && e . toState == 'center' ) {
347
349
this . onTabBodyCentering . emit ( this . _elementRef . nativeElement . clientHeight ) ;
348
350
}
349
351
}
350
352
351
- _onAnimationComplete ( e : AnimationTransitionEvent ) {
353
+ _onTranslateTabComplete ( e : AnimationTransitionEvent ) {
352
354
if ( ( e . toState == 'left' || e . toState == 'right' ) && this . _position !== 'center' ) {
353
355
// If the end state is that the tab is not centered, then detach the content.
354
356
this . _portalHost . detach ( ) ;
0 commit comments