Dan
Well-known member
Code:
XenForo.Tooltip = function($element)
{
var tipClass = String($element.data('tipclass') || ''),
isFlipped = /(\s|^)flipped(\s|$)/.test(tipClass),
offsetY = parseInt($element.data('offsety'), 10) || -6,
innerWidth = $element.is(':visible') ? $element.innerWidth() : 0,
dataOffsetX = parseInt($element.data('offsetx'), 10) || 0,
offsetX = dataOffsetX + innerWidth * (isFlipped ? 1 : -1),
title = XenForo.htmlspecialchars($element.attr('title'));
var onBeforeShow = null;
if (innerWidth <= 0)
{
var positionUpdated = false;
onBeforeShow = function()
{
if (positionUpdated)
{
return;
}
var width = $element.innerWidth();
if (width <= 0)
{
return;
}
positionUpdated = true;
offsetX = dataOffsetX + width * (isFlipped ? 1 : -1);
$element.data('tooltip').getConf().offset = XenForo.switchOffsetRTL([ offsetY, offsetX ]);
};
}
needs to be changed to
Rich (BB code):
XenForo.Tooltip = function($element)
{
var tipClass = String($element.data('tipclass') || ''),
isFlipped = /(\s|^)flipped(\s|$)/.test(tipClass),
offsetY = parseInt($element.data('offsety'), 10) || -6,
innerWidth = $element.is(':visible') ? $element.innerWidth() : 0,
dataOffsetX = parseInt($element.data('offsetx'), 10) || 0,
offsetX = dataOffsetX + innerWidth * (isFlipped ? 1 : -1),
title = XenForo.htmlspecialchars($element.attr('title'));
var onBeforeShow = null;
if (innerWidth <= 0)
{
var positionUpdated = false;
onBeforeShow = function()
{
if (positionUpdated)
{
return;
}
var width = $element.innerWidth();
if (width <= 0)
{
return;
}
positionUpdated = true;
offsetX = dataOffsetX + width * (isFlipped ? 1 : -1);
this.getConf().offset = XenForo.switchOffsetRTL([ offsetY, offsetX ]);
};
}
$element.data('tooltip') will throw following js error:
TypeError: $element.data(...) is undefined