moved not always needed code out of event handler, fixed display with larger font

This commit is contained in:
Sebastian Mendel
2005-10-19 14:53:19 +00:00
parent 798558ea4d
commit 4e99e2d1f2
4 changed files with 82 additions and 60 deletions

View File

@@ -11,7 +11,8 @@ $Source$
2005-10-19 Sebastian Mendel <cybot_tm@users.sourceforge.net> 2005-10-19 Sebastian Mendel <cybot_tm@users.sourceforge.net>
* footer.inc.php, index.php, server_databases.php, libraries/querywindow.js: * footer.inc.php, index.php, server_databases.php, libraries/querywindow.js:
fix problem not remembering selected server fix problem not remembering selected server
* libraries/tooltip.js: moved not always needed code out of event handler * libraries/tooltip.js, themes/*/theme_right.css.php:
moved not always needed code out of event handler, fixed display with larger font
2005-10-18 Michal Čihař <michal@cihar.com> 2005-10-18 Michal Čihař <michal@cihar.com>
* libraries/relation.lib.php: Do not set database if not needed. * libraries/relation.lib.php: Do not set database if not needed.

View File

@@ -37,6 +37,8 @@ if ( (ttDOM) || (ttIE4) || (ttNS4) ) {
/** /**
* init the tooltip and write the text into it * init the tooltip and write the text into it
*
* @param string theText tooltip content
*/ */
function textTooltip(theText) { function textTooltip(theText) {
if (ttDOM || ttIE4) { // document.getEelementById || document.all if (ttDOM || ttIE4) { // document.getEelementById || document.all
@@ -50,9 +52,15 @@ function textTooltip(theText) {
} }
/** /**
* swap the Tooltip // show and hide * @var integer
*/ */
var ttTimerID = 0; var ttTimerID = 0;
/**
* swap the Tooltip // show and hide
*
* @param boolean stat view status
*/
function swapTooltip(stat) { function swapTooltip(stat) {
if (ttHoldIt!=1) { if (ttHoldIt!=1) {
if (stat!='default') { if (stat!='default') {
@@ -77,32 +85,10 @@ function swapTooltip(stat) {
/** /**
* show / hide the Tooltip * show / hide the Tooltip
*
* @param boolean stat view status
*/ */
function showTooltip(stat) { function showTooltip(stat) {
var plusX=0, plusY=0, docX=0; docY=0;
var divHeight = myTooltipContainer.clientHeight;
var divWidth = myTooltipContainer.clientWidth;
if (navigator.appName.indexOf("Explorer")!=-1) {
if (document.documentElement && document.documentElement.scrollTop) {
plusX = document.documentElement.scrollLeft;
plusY = document.documentElement.scrollTop;
docX = document.documentElement.offsetWidth + plusX;
docY = document.documentElement.offsetHeight + plusY;
} else {
plusX = document.body.scrollLeft;
plusY = document.body.scrollTop;
docX = document.body.offsetWidth + plusX;
docY = document.body.offsetHeight + plusY;
}
} else {
docX = document.body.clientWidth;
docY = document.body.clientHeight;
}
if ((ttXpos + divWidth) > docX)
ttXpos = ttXpos - (divWidth + (ttXadd * 2));
if ((ttYpos + divHeight) > docY)
ttYpos = ttYpos - (divHeight + (ttYadd * 2));
if (stat==false) { if (stat==false) {
if (ttNS4) if (ttNS4)
myTooltipContainer.visibility = "hide"; myTooltipContainer.visibility = "hide";
@@ -128,6 +114,9 @@ function holdTooltip() {
/** /**
* move the tooltip to mouse position * move the tooltip to mouse position
*
* @param integer posX horiz. position
* @param integer posY vert. position
*/ */
function moveTooltip(posX, posY) { function moveTooltip(posX, posY) {
if (ttDOM || ttIE4) { if (ttDOM || ttIE4) {
@@ -141,8 +130,38 @@ function moveTooltip(posX, posY) {
/** /**
* build the tooltip * build the tooltip
*
* @param string theText tooltip content
*/ */
function pmaTooltip(theText) { function pmaTooltip(theText) {
var plusX=0, plusY=0, docX=0; docY=0;
var divHeight = myTooltipContainer.clientHeight;
var divWidth = myTooltipContainer.clientWidth;
if (navigator.appName.indexOf("Explorer")!=-1) {
if (document.documentElement && document.documentElement.scrollTop) {
plusX = document.documentElement.scrollLeft;
plusY = document.documentElement.scrollTop;
docX = document.documentElement.offsetWidth + plusX;
docY = document.documentElement.offsetHeight + plusY;
} else {
plusX = document.body.scrollLeft;
plusY = document.body.scrollTop;
docX = document.body.offsetWidth + plusX;
docY = document.body.offsetHeight + plusY;
}
} else {
docX = document.body.clientWidth;
docY = document.body.clientHeight;
}
ttXpos = ttXpos + plusX;
ttYpos = ttYpos + plusY;
if ((ttXpos + divWidth) > docX)
ttXpos = ttXpos - (divWidth + (ttXadd * 2));
if ((ttYpos + divHeight) > docY)
ttYpos = ttYpos - (divHeight + (ttYadd * 2));
textTooltip(theText); textTooltip(theText);
moveTooltip((ttXpos + ttXadd), (ttYpos + ttYadd)); moveTooltip((ttXpos + ttXadd), (ttYpos + ttYadd));
holdTooltip(); holdTooltip();
@@ -150,6 +169,8 @@ function pmaTooltip(theText) {
/** /**
* register mouse moves * register mouse moves
*
* @param event e
*/ */
function mouseMove(e) { function mouseMove(e) {
if ( typeof( event ) != 'undefined' ) { if ( typeof( event ) != 'undefined' ) {

View File

@@ -529,14 +529,14 @@ tr.disabled td, td.disabled {
#TooltipContainer { #TooltipContainer {
position: absolute; position: absolute;
z-index: 99; z-index: 99;
width: 250px; width: 20em;
height: 50px; height: auto;
overflow: auto; overflow: visible;
visibility: hidden; visibility: hidden;
background-color: #ffffcc; background-color: #ffffcc;
color: #006600; color: #006600;
border: 1px solid #000000; border: 0.1em solid #000000;
padding: 5px; padding: 0.5em;
font-family: Verdana, Arial, Helvetica, sans-serif; font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px; font-size: 10px;
} }

View File

@@ -315,14 +315,14 @@ tr.disabled td, td.disabled {
#TooltipContainer { #TooltipContainer {
position: absolute; position: absolute;
z-index: 99; z-index: 99;
width: 250px; width: 20em;
height: 50px; height: auto;
overflow: auto; overflow: visible;
visibility: hidden; visibility: hidden;
background-color: #ffffcc; background-color: #ffffcc;
color: #006600; color: #006600;
border: 1px solid #000000; border: 0.1em solid #000000;
padding: 5px; padding: 0.5em;
font-family: <?php echo $right_font_family; ?>; font-family: <?php echo $right_font_family; ?>;
font-size: <?php echo $font_size; ?>; font-size: <?php echo $font_size; ?>;
} }