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

pull/6407/head
Aleksander Machniak 6 years ago
parent 24e3977d74
commit 4633efb3df

@ -94,6 +94,7 @@ CHANGELOG Roundcube Webmail
- Fix so fallback from BINARY to BODY FETCH is used also on [PARSE] errors in dovecot 2.3 (#6383) - 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) - Enigma: Fix deleting keys with authentication subkeys (#6381)
- Fix invalid regular expressions that throw warnings on PHP 7.3 (#6398) - 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 RELEASE 1.3.7
------------- -------------

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

Loading…
Cancel
Save