Skip to content

Commit

Permalink
Fix bug#4799 Position of sticky columns wrong when screen width too s…
Browse files Browse the repository at this point in the history
…mall

Signed-off-by: Atul Pratap Singh <atulpratapsingh05@gmail.com>
  • Loading branch information
Raimund Meyer authored and atul516 committed Mar 15, 2015
1 parent dc29142 commit 9823122
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions js/sql.js
Expand Up @@ -8,7 +8,7 @@
*/

var $data_a;
var prevScrollX = 0, fixedTop;
var prevScrollX = 0;

/**
* decode a string URL_encoded
Expand Down Expand Up @@ -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 = $('<table class="sticky_columns"></table>')
.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;
}
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 9823122

Please sign in to comment.