@@ -20,7 +20,8 @@ import {
2020 animate ,
2121 transition ,
2222 AnimationTransitionEvent ,
23- ElementRef , Renderer ,
23+ ElementRef ,
24+ Renderer ,
2425} from '@angular/core' ;
2526import { CommonModule } from '@angular/common' ;
2627import {
@@ -30,14 +31,14 @@ import {
3031 LEFT_ARROW ,
3132 ENTER ,
3233 coerceBooleanProperty ,
34+ PortalHostDirective ,
3335} from '../core' ;
3436import { MdTabLabel } from './tab-label' ;
3537import { MdTabLabelWrapper } from './tab-label-wrapper' ;
3638import { MdTabNavBar , MdTabLink } from './tab-nav-bar/tab-nav-bar' ;
3739import { MdInkBar } from './ink-bar' ;
3840import { Observable } from 'rxjs/Observable' ;
3941import 'rxjs/add/operator/map' ;
40- import { PortalHostDirective } from '../core/portal/portal-directives' ;
4142
4243
4344/** Used to generate unique ID's for each tab component */
@@ -273,7 +274,7 @@ export class MdTabGroup {
273274 * Sets the height of the body wrapper to the height of the activating tab if dynamic
274275 * height property is true.
275276 */
276- _setTabBodyWrapperHeight ( e : number ) {
277+ _setTabBodyWrapperHeight ( tabHeight : number ) : void {
277278 if ( ! this . _dynamicHeight ) { return ; }
278279
279280 this . _renderer . setElementStyle ( this . _tabBodyWrapper . nativeElement , 'height' ,
@@ -282,12 +283,13 @@ export class MdTabGroup {
282283 // This conditional forces the browser to paint the height so that
283284 // the animation to the new height can have an origin.
284285 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' ) ;
286288 }
287289 }
288290
289291 /** Removes the height of the tab body wrapper. */
290- _removeTabBodyWrapperHeight ( ) {
292+ _removeTabBodyWrapperHeight ( ) : void {
291293 this . _renderer . setElementStyle ( this . _tabBodyWrapper . nativeElement , 'height' , '' ) ;
292294 }
293295}
@@ -299,7 +301,7 @@ export type MdTabBodyActiveState = 'left' | 'center' | 'right';
299301 selector : 'md-tab-body' ,
300302 templateUrl : 'tab-body.html' ,
301303 animations : [
302- trigger ( 'position ' , [
304+ trigger ( 'translateTab ' , [
303305 state ( 'left' , style ( { transform : 'translate3d(-100%, 0, 0)' } ) ) ,
304306 state ( 'center' , style ( { transform : 'translate3d(0, 0, 0)' } ) ) ,
305307 state ( 'right' , style ( { transform : 'translate3d(100%, 0, 0)' } ) ) ,
@@ -342,13 +344,13 @@ export class MdTabBody implements OnInit {
342344 }
343345 }
344346
345- _onAnimationStarted ( e : AnimationTransitionEvent ) {
347+ _onTranslateTabStarted ( e : AnimationTransitionEvent ) {
346348 if ( e . fromState != 'void' && e . toState == 'center' ) {
347349 this . onTabBodyCentering . emit ( this . _elementRef . nativeElement . clientHeight ) ;
348350 }
349351 }
350352
351- _onAnimationComplete ( e : AnimationTransitionEvent ) {
353+ _onTranslateTabComplete ( e : AnimationTransitionEvent ) {
352354 if ( ( e . toState == 'left' || e . toState == 'right' ) && this . _position !== 'center' ) {
353355 // If the end state is that the tab is not centered, then detach the content.
354356 this . _portalHost . detach ( ) ;
0 commit comments