make footnote tooltips work again; ensure ids are unique
This commit is contained in:
@@ -158,7 +158,7 @@ function moveTooltip(posX, posY)
|
|||||||
*/
|
*/
|
||||||
function pmaTooltip(e)
|
function pmaTooltip(e)
|
||||||
{
|
{
|
||||||
var theText = document.getElementById(this.getAttribute('name')).innerHTML;
|
var theText = document.getElementById('footnote_' + this.innerHTML).innerHTML;
|
||||||
|
|
||||||
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;
|
||||||
|
@@ -440,13 +440,18 @@ function PMA_showHint($message, $bbcode = false, $type = 'notice')
|
|||||||
|
|
||||||
if (! isset($GLOBALS['footnotes'][$key])) {
|
if (! isset($GLOBALS['footnotes'][$key])) {
|
||||||
$nr = count($GLOBALS['footnotes']) + 1;
|
$nr = count($GLOBALS['footnotes']) + 1;
|
||||||
|
// this is the first instance of this message
|
||||||
|
$instance = 1;
|
||||||
$GLOBALS['footnotes'][$key] = array(
|
$GLOBALS['footnotes'][$key] = array(
|
||||||
'note' => $message,
|
'note' => $message,
|
||||||
'type' => $type,
|
'type' => $type,
|
||||||
'nr' => $nr,
|
'nr' => $nr,
|
||||||
|
'instance' => $instance
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
$nr = $GLOBALS['footnotes'][$key]['nr'];
|
$nr = $GLOBALS['footnotes'][$key]['nr'];
|
||||||
|
// another instance of this message (to ensure ids are unique)
|
||||||
|
$instance = ++$GLOBALS['footnotes'][$key]['instance'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($bbcode) {
|
if ($bbcode) {
|
||||||
@@ -454,7 +459,7 @@ function PMA_showHint($message, $bbcode = false, $type = 'notice')
|
|||||||
}
|
}
|
||||||
|
|
||||||
// footnotemarker used in js/tooltip.js
|
// footnotemarker used in js/tooltip.js
|
||||||
return '<sup class="footnotemarker" id="footnote_sup_' . $nr . '">' . $nr . '</sup>';
|
return '<sup class="footnotemarker" id="footnote_sup_' . $nr . '_' . $instance . '">' . $nr . '</sup>';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user