Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/roundcube/roundcubemail.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/skins
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2018-08-19 10:51:45 +0300
committerAleksander Machniak <alec@alec.pl>2018-08-19 10:52:19 +0300
commit017819df00936c78ed314bda7d91ce8e8f0b9eb1 (patch)
tree9a9999bc425a03361c245766f0c070fa87ea700d /skins
parent8b6da9a65a0cf86ee7b45eae0a0ec25ce5f52ebd (diff)
Fix so Classic skin splitter does not escape out of window (#6397)
Diffstat (limited to 'skins')
-rw-r--r--skins/classic/splitter.js12
1 files changed, 9 insertions, 3 deletions
diff --git a/skins/classic/splitter.js b/skins/classic/splitter.js
index 4117b2c29..460c35a21 100644
--- a/skins/classic/splitter.js
+++ b/skins/classic/splitter.js
@@ -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';