}
// calculate top offset
- var $top = $elementOffsets.top + $elementDimensions.height + 7;
+ if ($elementOffsets.top + $elementDimensions.height + $tooltipDimensions.height - $(document).scrollTop() < $(window).height()) {
+ var $top = $elementOffsets.top + $elementDimensions.height + 7;
+ this._tooltip.removeClass('inverse');
+ $arrow.css('top', -5);
+ }
+ else {
+ var $top = $elementOffsets.top - $elementDimensions.height - 7;
+ this._tooltip.addClass('inverse');
+ $arrow.css('top', $tooltipDimensions.height);
+ }
// calculate left offset
switch ($alignment) {
z-index: 800;
.borderRadius(6px);
- .boxShadow(0, 3px, rgba(0, 0, 0, .3), 7px);
-
.pointer {
border-color: @wcfTooltipBackgroundColor transparent;
border-style: solid;
position: absolute;
top: -5px;
}
+
+ .boxShadow(0, 3px, rgba(0, 0, 0, .3), 7px);
+
+ &.inverse {
+ .boxShadow(0, -3px, rgba(0, 0, 0, .3), 7px);
+ .pointer {
+ border-width: 5px 5px 0;
+ }
+ }
}
/* popover */