Fix so Classic skin splitter does not escape out of window (#6397)

pull/6465/head
Aleksander Machniak 6 years ago
parent 8b6da9a65a
commit 017819df00

@ -5,6 +5,7 @@ CHANGELOG Roundcube Webmail
- Fix so fallback from BINARY to BODY FETCH is used also on [PARSE] errors in dovecot 2.3 (#6383)
- Enigma: Fix deleting keys with authentication subkeys (#6381)
- Fix invalid regular expressions that throw warnings on PHP 7.3 (#6398)
- Fix so Classic skin splitter does not escape out of window (#6397)
RELEASE 1.3.7
-------------

@ -56,6 +56,9 @@ function rcube_splitter(attrib)
// add the mouse event listeners
$(this.elm).mousedown(onDragStart);
// Update splitter position and elements with on window resize
$(window).resize(function(e) { if (e.target === window) me.resize(); });
if (bw.ie)
$(window).resize(onResize);
@ -88,9 +91,12 @@ function rcube_splitter(attrib)
}
}
else {
this.p1.style.width = Math.floor(this.pos - this.p1pos.left - this.layer.width / 2) + 'px';
this.p2.style.left = Math.ceil(this.pos + this.layer.width / 2) + 'px';
this.layer.move(Math.round(this.pos - this.layer.width / 2 + 1), this.layer.y);
var max_width = $(window).width() - $(this.p1).offset().left - 150,
pos = Math.min(this.pos, max_width);
this.p1.style.width = Math.floor(pos - this.p1pos.left - this.layer.width / 2) + 'px';
this.p2.style.left = Math.ceil(pos + this.layer.width / 2) + 'px';
this.layer.move(Math.round(pos - this.layer.width / 2 + 1), this.layer.y);
if (bw.ie) {
var new_width = parseInt(this.p2.parentNode.offsetWidth, 10) - parseInt(this.p2.style.left, 10) ;
this.p2.style.width = (new_width > 0 ? new_width : 0) + 'px';

Loading…
Cancel
Save