Skip to content

Commit

Permalink
[ui:cwd] correction of fixed table header on dirction rtl
Browse files Browse the repository at this point in the history
  • Loading branch information
nao-pon committed May 27, 2016
1 parent 40f4a4e commit 63dceca
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions js/ui/cwd.js
Original file line number Diff line number Diff line change
Expand Up @@ -584,11 +584,22 @@ $.fn.elfindercwd = function(fm, options) {
.css(wrapper.position())
.css('height', hheight)
.append(base);
if (fm.direction === 'rtl') {
tableHeader.css('right', (fm.getUI().width() - wrapper.width()) + 'px');
}
wrapper.after(tableHeader)
.on('scroll.fixheader resize.fixheader', function(e) {
var left = wrapper.scrollLeft() * -1;
if (base.css('left') !== left) {
base.css('left', left);
var val, pos;

if (fm.direction === 'ltr') {
val = wrapper.scrollLeft() * -1;
pos = 'left';
} else {
val = wrapper.scrollLeft();
pos = 'right';
}
if (base.css(pos) !== val) {
base.css(pos, val);
}
if (e.type === 'resize') {
e.stopPropagation();
Expand All @@ -612,6 +623,9 @@ $.fn.elfindercwd = function(fm, options) {

tableHeader.data('widthTimer') && clearTimeout(tableHeader.data('widthTimer'));
tableHeader.data('widthTimer', setTimeout(function() {
if (fm.direction === 'rtl') {
tableHeader.css('right', (fm.getUI().width() - wrapper.width()) + 'px');
}
tableHeader.css(wrapper.position()).css('width', cwd.outerWidth() + 'px');
}, 10));
}
Expand Down

0 comments on commit 63dceca

Please sign in to comment.