From 1e7b57257c5bbf3e5c5dbb4edb2208074227dc56 Mon Sep 17 00:00:00 2001 From: Brandy Carney Date: Wed, 25 May 2016 17:56:00 -0400 Subject: [PATCH] feat(popover): adjust popover to position in the center with no event references #5420 --- src/components/popover/popover.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/popover/popover.ts b/src/components/popover/popover.ts index db3dcec14a6..d58e39433bd 100644 --- a/src/components/popover/popover.ts +++ b/src/components/popover/popover.ts @@ -32,7 +32,7 @@ const POPOVER_BODY_PADDING = 2; * The first argument passed to the `present` should be the popover. In order * to position the popover relative to the element clicked, the event needs to be * passed as the second argument. If the event is not passed, the popover will be - * positioned at the top of the current view. See the [usage](#usage) section for + * positioned in the center of the current view. See the [usage](#usage) section for * an example of passing this event. * * ### Dismissing @@ -250,7 +250,7 @@ class PopoverTransition extends Transition { let bodyWidth = window.innerWidth; let bodyHeight = window.innerHeight; - let targetTop = POPOVER_BODY_PADDING; + let targetTop = (bodyHeight / 2) - (popoverHeight / 2); let targetLeft = bodyWidth / 2; let targetWidth = 0; let targetHeight = 0;