diff --git a/js/navigation.js b/js/navigation.js index ffb2367e4c..ae2ec9c615 100644 --- a/js/navigation.js +++ b/js/navigation.js @@ -31,7 +31,7 @@ $(function () { event.stopImmediatePropagation(); PMA_expandNavigationTree($(this)); }); - + /** * Register event handler for click on the reload * navigation icon at the top of the panel @@ -329,7 +329,7 @@ function PMA_autoExpandDatabaseInUse($oldDb, $newDb) { //scroll to new database if ($oldDb !== $newDb) { setTimeout(function() { - scrollToView($expandElem.closest('li'), $('#pma_navigation_tree_content')); + scrollToView($expandElem.closest('li'), $('#pma_navigation_tree_content')); }, 150); } } @@ -630,6 +630,17 @@ var ResizeHandler = function () { event.data.resize_handler.setWidth(panel_width); event.data.resize_handler.panel_width = width; }; + /** + * Even thandler for resizing the navigation tree height on window resize + * + * @return void + */ + this.treeResize = function (event) { + var $nav = $("#pma_navigation"), + $nav_tree = $("#pma_navigation_tree"), + $nav_header = $("#pma_navigation_header"); + $nav_tree.height($nav.height() - $nav_header.height()); + }; /* Initialisation section begins here */ if ($.cookie('pma_navi_width')) { // If we have a cookie, set the width of the panel to its value @@ -647,6 +658,11 @@ var ResizeHandler = function () { $collapser.live('click', {'resize_handler': this}, this.collapse); // Add the correct arrow symbol to the collapser $collapser.html(this.getSymbol($('#pma_navigation').width())); + // Fix navigation tree height + $(window).on('resize', this.treeResize); + // need to call this now and then, browser might decide + // to show/hide horizontal scrollbars depending on page content width + setInterval(this.treeResize, 2000); }; // End of ResizeHandler /** diff --git a/libraries/navigation/NavigationHeader.class.php b/libraries/navigation/NavigationHeader.class.php index 4e8873ee23..7c9e8c3a7f 100644 --- a/libraries/navigation/NavigationHeader.class.php +++ b/libraries/navigation/NavigationHeader.class.php @@ -41,6 +41,7 @@ class PMA_NavigationHeader $buffer .= '
'; $buffer .= '
'; $buffer .= '
'; + $buffer .= '
'; $buffer .= sprintf( '', $link_url @@ -54,6 +55,7 @@ class PMA_NavigationHeader __('Loading…'), array('style' => 'visibility: hidden;', 'class' => 'throbber') ); + $buffer .= '
'; // pma_navigation_header $buffer .= '
'; return $buffer; } diff --git a/themes/original/css/navigation.css.php b/themes/original/css/navigation.css.php index 6cee7d40d6..8b5d17753e 100644 --- a/themes/original/css/navigation.css.php +++ b/themes/original/css/navigation.css.php @@ -105,7 +105,7 @@ if (! defined('PMA_MINIMUM_COMMON') && ! defined('TESTSUITE')) { /* Navigation tree*/ #pma_navigation_tree { - margin: 0.5em 0 0; + margin: 0; margin-: 1em; color: #444; height: 74%; diff --git a/themes/pmahomme/css/navigation.css.php b/themes/pmahomme/css/navigation.css.php index 23346f8734..e944d663aa 100644 --- a/themes/pmahomme/css/navigation.css.php +++ b/themes/pmahomme/css/navigation.css.php @@ -73,7 +73,7 @@ if (! defined('PMA_MINIMUM_COMMON') && ! defined('TESTSUITE')) { #pma_navigation #databaseList, #pma_navigation div.pageselector.dbselector { text-align: center; - margin: 5px 10px 0px; + padding: 5px 10px 0px; border: 0; } @@ -90,7 +90,7 @@ if (! defined('PMA_MINIMUM_COMMON') && ! defined('TESTSUITE')) { /* Navigation tree*/ #pma_navigation_tree { - margin: 5px 0 0; + margin: 0; margin-: 10px; color: #444; height: 74%; /*it needs to be dynamically set*/