From 5a08d00d4c10667368fc10915fecc890c3d9336d Mon Sep 17 00:00:00 2001 From: Manish Bisht Date: Tue, 13 Jun 2017 21:58:04 +0530 Subject: [PATCH] merge conflict removed in navigation.js Signed-off-by: Manish Bisht --- js/navigation.js | 14 ++++++++++++-- themes/pmahomme/css/navigation.css.php | 11 +++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/js/navigation.js b/js/navigation.js index 4af3070eca..e85f31b935 100644 --- a/js/navigation.js +++ b/js/navigation.js @@ -1119,6 +1119,7 @@ var ResizeHandler = function () { var $resizer = $('#pma_navigation_resizer'); var resizer_width = $resizer.width(); var $collapser = $('#pma_navigation_collapser'); + var windowWidth = $(window).width(); $('#pma_navigation').width(pos); $('body').css('margin-' + this.left, pos + 'px'); $("#floating_menubar, #pma_console") @@ -1129,6 +1130,12 @@ var ResizeHandler = function () { .css(this.left, pos + resizer_width) .html(this.getSymbol(pos)) .prop('title', PMA_messages.strShowPanel); + } else if (windowWidth < 768) { + $collapser + .css(this.left, windowWidth - 22) + .html(this.getSymbol(100)) + .prop('title', PMA_messages.strHidePanel); + $('#pma_navigation').width(windowWidth); } else { $collapser .css(this.left, pos) @@ -1271,8 +1278,11 @@ var ResizeHandler = function () { // Set content bottom space beacuse of console $('body').css('margin-bottom', $('#pma_console').height() + 'px'); }; - /* Initialisation section begins here */ - if (Cookies.get('pma_navi_width')) { + // Hide the pma_navigation initially when loaded on mobile + if ($(window).width() < 768) { + this.setWidth(0); + } + else if (Cookies.get('pma_navi_width')) { // If we have a cookie, set the width of the panel to its value var pos = Math.abs(parseInt(Cookies.get('pma_navi_width'), 10) || 0); this.setWidth(pos); diff --git a/themes/pmahomme/css/navigation.css.php b/themes/pmahomme/css/navigation.css.php index caf35083b3..e99cada940 100644 --- a/themes/pmahomme/css/navigation.css.php +++ b/themes/pmahomme/css/navigation.css.php @@ -426,3 +426,14 @@ li.fast_filter.db_fast_filter { float: left; padding: .1em .3em 0; } + +@media only screen and (max-width: 768px) { + /* For mobile phones: */ + #pma_navigation { + width: 100%; + } + + #pma_navigation_resizer { + width: 0; + } +} \ No newline at end of file