From 98231225e2c962ce224807546c62c6b241040550 Mon Sep 17 00:00:00 2001 From: Raimund Meyer Date: Sun, 15 Mar 2015 15:25:12 +0530 Subject: Fix bug#4799 Position of sticky columns wrong when screen width too small Signed-off-by: Atul Pratap Singh --- js/sql.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'js/sql.js') diff --git a/js/sql.js b/js/sql.js index 49e0723973..e57792883d 100644 --- a/js/sql.js +++ b/js/sql.js @@ -8,7 +8,7 @@ */ var $data_a; -var prevScrollX = 0, fixedTop; +var prevScrollX = 0; /** * decode a string URL_encoded @@ -771,14 +771,13 @@ function setStickyColumnsPosition($sticky_columns, $table_results, position, top * Initialize sticky columns */ function initStickyColumns($table_results) { - fixedTop = $('#floating_menubar').height(); var $sticky_columns = $('
') .insertBefore($table_results) .css("position", "fixed") .css("z-index", "99") .css("width", $table_results.width()) .css("margin-left", $('#page_content').css("margin-left")) - .css("top", fixedTop) + .css("top", $('#floating_menubar').height()) .css("display", "none"); return $sticky_columns; } @@ -823,10 +822,10 @@ function handleStickyColumns($sticky_columns, $table_results) { //for horizontal scrolling if(prevScrollX != currentScrollX) { prevScrollX = currentScrollX; - setStickyColumnsPosition($sticky_columns, $table_results, "absolute", fixedTop + windowOffset - tableStartOffset); + setStickyColumnsPosition($sticky_columns, $table_results, "absolute", $('#floating_menubar').height() + windowOffset - tableStartOffset); //for vertical scrolling } else { - setStickyColumnsPosition($sticky_columns, $table_results, "fixed", fixedTop, $("#pma_navigation").width() - currentScrollX, $('#page_content').css("margin-left")); + setStickyColumnsPosition($sticky_columns, $table_results, "fixed", $('#floating_menubar').height(), $("#pma_navigation").width() - currentScrollX, $('#page_content').css("margin-left")); } $sticky_columns.show(); } else { -- cgit v1.2.3