Skip to content

Commit

Permalink
feat(popover): adjust popover to position in the center with no event
Browse files Browse the repository at this point in the history
references #5420
  • Loading branch information
brandyscarney committed May 25, 2016
1 parent ec540c4 commit 1e7b572
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/popover/popover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 1e7b572

Please sign in to comment.