Skip to content

Commit

Permalink
Fix left for fixed position with horizontal scroll (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeykuz authored and liviucmg committed Nov 19, 2016
1 parent 09cdee9 commit d1bc879
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion js/theia-sticky-sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,11 +255,12 @@
* It's way slower to first check if the values have changed.
*/
if (position == 'fixed') {
var scrollLeft = $(document).scrollLeft();
o.stickySidebar.css({
'position': 'fixed',
'width': getWidthForObject(o.stickySidebar) + 'px',
'transform': 'translateY(' + top + 'px)',
'left': (o.sidebar.offset().left + parseInt(o.sidebar.css('padding-left'))) + 'px',
'left': (o.sidebar.offset().left + parseInt(o.sidebar.css('padding-left')) - scrollLeft) + 'px',
'top': '0px'
});
}
Expand Down

0 comments on commit d1bc879

Please sign in to comment.