Don't use an href attribute on navigation expander links.

These links can't be opened in a new window anyway.
This commit is contained in:
Rouslan Placella 2012-06-27 15:50:30 +01:00
parent 783897e60a
commit 63ef473dcc
4 changed files with 16 additions and 11 deletions

View File

@ -3786,8 +3786,8 @@ AJAX.registerOnload('functions.js', function () {
// Load the navigation into the initial page
$(function () {
if ($('#pma_navigation_tree').length) {
var url = $('#pma_navigation_tree').find('a').attr('href');
$.get(url, function (data) {
var url = $('#pma_navigation').find('a.navigation_url').attr('href');
$.get(url, 'full=true', function (data) {
if (data.success) {
$('#pma_navigation_tree').html(data.message).children('div').show();
}

View File

@ -29,7 +29,12 @@ $(document).ready(function() {
var $throbber = $('.throbber').first().clone().show();
$icon.hide();
$throbber.insertBefore($icon);
$.get($this.attr('href'), {ajax_request: true}, function (data) {
var params = {
a_path: $(this).find('span.a_path').text(),
v_path: $(this).find('span.v_path').text()
};
var url = $('#pma_navigation').find('a.navigation_url').attr('href');
$.get(url, params, function (data) {
if (data.success === true) {
$this.addClass('loaded');
$destination.find('div.list_container').remove(); // FIXME: Hack, there shouldn't be a list container there

View File

@ -19,16 +19,16 @@ class PMA_NavigationHeader
$link_url = PMA_generate_common_url(
array(
'ajax_request' => true,
'full' => true
'ajax_request' => true
)
);
$link = sprintf(
'<a class="hide" href="navigation.php%s"></a>',
'<a class="hide navigation_url" href="navigation.php%s"></a>',
$link_url
);
$buffer = '<div id="pma_navigation">';
$buffer .= $link;
$buffer .= '<div id="pma_navigation_resizer"></div>';
$buffer .= '<div id="pma_navigation_collapser"></div>';
$buffer .= $this->logo();
@ -36,7 +36,6 @@ class PMA_NavigationHeader
$buffer .= $this->serverChoice();
$buffer .= $this->recent();
$buffer .= '<div id="pma_navigation_tree">';
$buffer .= $link;
$buffer .= '<div style="text-align:center; margin-top:1em;">';
$buffer .= $this->_commonFunctions->getImage(
'ajax_clock_small.gif',

View File

@ -479,15 +479,14 @@ class CollapsibleTree {
) {
$a_path = array();
foreach ($node->parents(true, true, false) as $parent) {
$a_path[] = urlencode(base64_encode($parent->real_name));
$a_path[] = base64_encode($parent->real_name);
}
$a_path = implode('.', array_reverse($a_path));
$v_path = array();
foreach ($node->parents(true, true, true) as $parent) {
$v_path[] = urlencode(base64_encode($parent->name));
$v_path[] = base64_encode($parent->name);
}
$v_path = implode('.', array_reverse($v_path));
$link = "navigation.php?" . PMA_generate_common_url() . "&amp;a_path=$a_path&amp;v_path=$v_path";
$loaded = '';
if ($node->is_group || $GLOBALS['cfg']['LeftFrameLight'] != true || $this->is_loaded) {
$loaded = ' loaded';
@ -501,7 +500,9 @@ class CollapsibleTree {
if (strpos($class, 'last') === false) {
$retval .= "<b></b>";
}
$retval .= "<a class='expander$loaded$container' target='_self' href='$link'>";
$retval .= "<a class='expander$loaded$container' target='_self' href='#'>";
$retval .= "<span class='hide a_path'>" . $a_path . "</span>";
$retval .= "<span class='hide v_path'>" . $v_path . "</span>";
$retval .= $this->_commonFunctions->getImage('b_plus.png');
$retval .= "</a>";
$retval .= "</div>";