From a7a147422902892e6438674ee41551dc008f4072 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Tue, 18 Feb 2014 16:55:55 +0000 Subject: [PATCH] Add a check for invalid position preference. This happens if the user has switched to a window smaller than previous, where their preference is now invalid. Fixes splitter at top when viewing mail in smaller window. --- etemplate/js/et2_widget_split.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/etemplate/js/et2_widget_split.js b/etemplate/js/et2_widget_split.js index 1b0e050404..c99c107138 100644 --- a/etemplate/js/et2_widget_split.js +++ b/etemplate/js/et2_widget_split.js @@ -186,8 +186,12 @@ var et2_split = et2_DOMWidget.extend([et2_IResizeable], var pref = this.egw().preference('splitter-size-' + this.id, this.egw().getAppName()); if(pref) { - options = $j.extend(options, pref); - this.prefSize = pref[this.orientation == "v" ?'sizeLeft' : 'sizeTop']; + if(this.orientation == "v" && pref['sizeLeft'] < this.dynheight.outerNode.width() || + this.orientation == "h" && pref['sizeTop'] < this.dynheight.outerNode.height()) + { + options = $j.extend(options, pref); + this.prefSize = pref[this.orientation == "v" ?'sizeLeft' : 'sizeTop']; + } } }