Fixed updating of the title of the page
This commit is contained in:
parent
9063e76a95
commit
50266d206b
@ -155,6 +155,10 @@ var AJAX = {
|
||||
|
||||
AJAX.scriptHandler.reset();
|
||||
|
||||
if (data._title) {
|
||||
$('title').replaceWith(data._title);
|
||||
}
|
||||
|
||||
if (data._menu) {
|
||||
$('#floating_menubar').html(data._menu)
|
||||
.children().first().remove(); // Remove duplicate wrapper (TODO: don't send it in the response)
|
||||
|
||||
18
js/common.js
18
js/common.js
@ -267,21 +267,3 @@ function openDb(new_db)
|
||||
refreshMain(opendb_url);
|
||||
return true;
|
||||
}
|
||||
|
||||
function updateTableTitle( table_link_id, new_title )
|
||||
{
|
||||
//alert('updateTableTitle');
|
||||
if ( window.parent.frame_navigation.document && window.parent.frame_navigation.document.getElementById(table_link_id) ) {
|
||||
var left = window.parent.frame_navigation.document;
|
||||
|
||||
var link = left.getElementById(table_link_id);
|
||||
link.title = window.parent.pma_text_default_tab + ': ' + new_title;
|
||||
|
||||
var link = left.getElementById('quick_' + table_link_id);
|
||||
link.title = window.parent.pma_text_left_default_tab + ': ' + new_title;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -293,7 +293,7 @@ class PMA_Header
|
||||
$retval .= $this->_getHtmlStart();
|
||||
$retval .= $this->_getMetaTags();
|
||||
$retval .= $this->_getLinkTags();
|
||||
$retval .= $this->_getTitleTag();
|
||||
$retval .= $this->getTitleTag();
|
||||
$title = PMA_sanitize(
|
||||
PMA_escapeJsString($this->_getPageTitle()),
|
||||
false,
|
||||
@ -452,7 +452,7 @@ class PMA_Header
|
||||
*
|
||||
* @return string the TITLE tag
|
||||
*/
|
||||
private function _getTitleTag()
|
||||
public function getTitleTag()
|
||||
{
|
||||
$retval = "<title>";
|
||||
$retval .= $this->_getPageTitle();
|
||||
|
||||
@ -291,6 +291,7 @@ class PMA_Response
|
||||
}
|
||||
|
||||
if ($this->_isAjaxPage) {
|
||||
$this->addJSON('_title', $this->getHeader()->getTitleTag());
|
||||
$this->addJSON('_menu', $this->getHeader()->getMenu()->getDisplay());
|
||||
$this->addJSON('_scripts', $this->getHeader()->getScripts()->getFiles());
|
||||
$url = basename(PMA_getenv('SCRIPT_NAME')) . '?' . PMA_generate_common_url();
|
||||
|
||||
@ -1056,22 +1056,6 @@ class PMA_Util
|
||||
unset($GLOBALS['using_bookmark_message']);
|
||||
}
|
||||
|
||||
// Corrects the tooltip text via JS if required
|
||||
// @todo this is REALLY the wrong place to do this - very unexpected here
|
||||
if (! $is_view && strlen($GLOBALS['table']) && $cfg['ShowTooltip']) {
|
||||
$tooltip = PMA_Table::sGetToolTip($GLOBALS['db'], $GLOBALS['table']);
|
||||
$uni_tbl = PMA_jsFormat($GLOBALS['db'] . '.' . $GLOBALS['table'], false);
|
||||
$retval .= "\n";
|
||||
$retval .= '<script type="text/javascript">' . "\n";
|
||||
$retval .= '//<![CDATA[' . "\n";
|
||||
$retval .= 'if (window.parent.updateTableTitle) {' . "\n";
|
||||
$retval .= " window.parent.updateTableTitle('"
|
||||
. $uni_tbl . "', '" . PMA_jsFormat($tooltip, false) . "');" . "\n";
|
||||
$retval .= '}' . "\n";
|
||||
$retval .= '//]]>' . "\n";
|
||||
$retval .= '</script>' . "\n";
|
||||
} // end if ... elseif
|
||||
|
||||
// In an Ajax request, $GLOBALS['cell_align_left'] may not be defined. Hence,
|
||||
// check for it's presence before using it
|
||||
$retval .= '<div id="result_query"'
|
||||
|
||||
Loading…
Reference in New Issue
Block a user