Center popover above/under

fixed popover code to center popover around triggerElement when
placement is top or bottom