import { App } from '../app/app' ; import { Config } from '../../config/config' ; import { isPresent } from '../../util/util' ; import { NavOptions } from '../../navigation/nav-util' ; import { PopoverCmp } from './popover-component' ; import { PopoverOptions } from './popover-options' ; import { PopoverMdPopIn , PopoverMdPopOut , PopoverPopIn , PopoverPopOut } from './popover-transitions' ; import { ViewController } from '../../navigation/view-controller' ; hidden export class PopoverImpl extends ViewController { private _app : App ; constructor ( app , component , data = { } , opts = { } , config ) { opts . showBackdrop = isPresent ( opts . showBackdrop ) ? ! ! opts . showBackdrop : true ; opts . enableBackdropDismiss = isPresent ( opts . enableBackdropDismiss ) ? ! ! opts . enableBackdropDismiss : true ; data . component = component ; data . opts = opts ; super ( PopoverCmp , data , null ) ; this . _app = app ; this . isOverlay = true ; config . setTransition ( 'popover-pop-in' , PopoverPopIn ) ; config . setTransition ( 'popover-pop-out' , PopoverPopOut ) ; config . setTransition ( 'popover-md-pop-in' , PopoverMdPopIn ) ; config . setTransition ( 'popover-md-pop-out' , PopoverMdPopOut ) ; } hidden getTransitionName ( direction ) { let key = ( direction === 'back' ? 'popoverLeave' : 'popoverEnter' ) ; return this . _nav && this . _nav . config . get ( key ) ; } param { NavOptions } navOptions returns { Promise } present ( navOptions = { } ) { return this . _app . present ( this , navOptions ) ; } }