From ca2a964e459cf2fd3936992efd037eccc63a61f6 Mon Sep 17 00:00:00 2001 From: Atul Pratap Singh Date: Fri, 27 Feb 2015 13:23:19 +0530 Subject: [PATCH] Fix bug#4782 Sticky column top alignment broken on horizontal scroll Signed-off-by: Atul Pratap Singh --- js/sql.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/js/sql.js b/js/sql.js index 98cef0550f..4d03d30834 100644 --- a/js/sql.js +++ b/js/sql.js @@ -786,11 +786,12 @@ function initProfilingTables() /* * Set position, left, top, width of sticky_columns div */ -function setStickyColumnsPosition($sticky_columns, $table_results, position, top, left) { +function setStickyColumnsPosition($sticky_columns, $table_results, position, top, left, margin_left) { $sticky_columns .css("position", position) .css("top", top) .css("left", left ? left : "auto") + .css("margin-left", margin_left ? margin_left : "0px") .css("width", $table_results.width()); } @@ -850,10 +851,10 @@ function handleStickyColumns($sticky_columns, $table_results) { //for horizontal scrolling if(prevScrollX != currentScrollX) { prevScrollX = currentScrollX; - setStickyColumnsPosition($sticky_columns, $table_results, "absolute", fixedTop + windowOffset); + setStickyColumnsPosition($sticky_columns, $table_results, "absolute", fixedTop + windowOffset - tableStartOffset); //for vertical scrolling } else { - setStickyColumnsPosition($sticky_columns, $table_results, "fixed", fixedTop, $("#pma_navigation").width() - currentScrollX); + setStickyColumnsPosition($sticky_columns, $table_results, "fixed", fixedTop, $("#pma_navigation").width() - currentScrollX, $('#page_content').css("margin-left")); } $sticky_columns.show(); } else {