pmaTooltip(): no return value, additional check

This commit is contained in:
Sebastian Mendel
2005-11-14 10:59:40 +00:00
parent 3dac7a6e46
commit 69b5efe426
2 changed files with 13 additions and 8 deletions

View File

@@ -8,6 +8,7 @@ $Source$
2005-11-14 Sebastian Mendel <cybot_tm@users.sourceforge.net> 2005-11-14 Sebastian Mendel <cybot_tm@users.sourceforge.net>
* themes/*/css/theme_right.css.php, css/phpmyadmin.css.php: * themes/*/css/theme_right.css.php, css/phpmyadmin.css.php:
bug #1342683 Wrong URL to error.ico bug #1342683 Wrong URL to error.ico
* libraries/tooltip.js: no return value, additional check
2005-11-13 Michal Čihař <michal@cihar.com> 2005-11-13 Michal Čihař <michal@cihar.com>
* Documentation.html, config.default.php, main.php, server_links.inc.php, * Documentation.html, config.default.php, main.php, server_links.inc.php,

View File

@@ -43,10 +43,10 @@ function textTooltip(theText) {
layerNS4.write(theText); layerNS4.write(theText);
layerNS4.close(); layerNS4.close();
} }
} }
/** /**
* @var integer * @var integer
*/ */
var ttTimerID = 0; var ttTimerID = 0;
@@ -127,7 +127,7 @@ function moveTooltip(posX, posY) {
* *
* @param string theText tooltip content * @param string theText tooltip content
*/ */
function pmaTooltip(theText) { function pmaTooltip( theText ) {
// reference to TooltipContainer // reference to TooltipContainer
if ( null == myTooltipContainer ) { if ( null == myTooltipContainer ) {
if (ttNS4) { if (ttNS4) {
@@ -137,10 +137,14 @@ function pmaTooltip(theText) {
} else if (ttDOM) { } else if (ttDOM) {
myTooltipContainer = document.getElementById('TooltipContainer'); myTooltipContainer = document.getElementById('TooltipContainer');
} else { } else {
return false; return;
}
if ( typeof( myTooltipContainer ) == 'undefined' ) {
return;
} }
} }
var plusX=0, plusY=0, docX=0; docY=0; var plusX=0, plusY=0, docX=0; docY=0;
var divHeight = myTooltipContainer.clientHeight; var divHeight = myTooltipContainer.clientHeight;
var divWidth = myTooltipContainer.clientWidth; var divWidth = myTooltipContainer.clientWidth;
@@ -160,15 +164,15 @@ function pmaTooltip(theText) {
docX = document.body.clientWidth; docX = document.body.clientWidth;
docY = document.body.clientHeight; docY = document.body.clientHeight;
} }
ttXpos = ttXpos + plusX; ttXpos = ttXpos + plusX;
ttYpos = ttYpos + plusY; ttYpos = ttYpos + plusY;
if ((ttXpos + divWidth) > docX) if ((ttXpos + divWidth) > docX)
ttXpos = ttXpos - (divWidth + (ttXadd * 2)); ttXpos = ttXpos - (divWidth + (ttXadd * 2));
if ((ttYpos + divHeight) > docY) if ((ttYpos + divHeight) > docY)
ttYpos = ttYpos - (divHeight + (ttYadd * 2)); ttYpos = ttYpos - (divHeight + (ttYadd * 2));
textTooltip(theText); textTooltip(theText);
moveTooltip((ttXpos + ttXadd), (ttYpos + ttYadd)); moveTooltip((ttXpos + ttXadd), (ttYpos + ttYadd));
holdTooltip(); holdTooltip();