Merge branch 'master' of github.com:roundcube/roundcubemail

pull/7295/head
Aleksander Machniak 5 years ago
commit 005da225f6

@ -259,12 +259,18 @@ init_header: function()
} }
}, },
/**
* Set the scrollable parent object for the table's fixed header
*/
container: window,
init_fixed_header: function() init_fixed_header: function()
{ {
var clone = $(this.list.tHead).clone(); var clone = $(this.list.tHead).clone();
if (!this.fixed_header) { if (!this.fixed_header) {
this.fixed_header = $('<table>') this.fixed_header = $('<table>')
.attr('id', this.list.id + '-fixedcopy')
.attr('class', this.list.className + ' fixedcopy') .attr('class', this.list.className + ' fixedcopy')
.attr('role', 'presentation') .attr('role', 'presentation')
.css({ position:'fixed' }) .css({ position:'fixed' })
@ -273,14 +279,14 @@ init_fixed_header: function()
$(this.list).before(this.fixed_header); $(this.list).before(this.fixed_header);
var me = this; var me = this;
$(window).resize(function() { me.resize(); }); $(window).on('resize', function() { me.resize(); });
$(window).scroll(function() { $(this.container).on('scroll', function() {
var w = $(window); var w = $(this);
me.fixed_header.css({ me.fixed_header.css({
marginLeft: -w.scrollLeft() + 'px', marginLeft: -w.scrollLeft() + 'px',
marginTop: -w.scrollTop() + 'px' marginTop: -w.scrollTop() + 'px'
});
}); });
});
} }
else { else {
$(this.fixed_header).find('thead').replaceWith(clone); $(this.fixed_header).find('thead').replaceWith(clone);

Loading…
Cancel
Save