mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-29 17:29:11 +01:00
* Api: Fix splitter widget did not restore size from preference
This commit is contained in:
parent
4c503d61ea
commit
d35577f1a8
@ -154,11 +154,15 @@ var et2_split = /** @class */ (function (_super) {
|
||||
if (this.id) {
|
||||
var pref = this.egw().preference('splitter-size-' + this.id, this.egw().getAppName());
|
||||
if (pref) {
|
||||
if (this.orientation == "v" && pref['sizeLeft'] < this.dynheight.outerNode.width() ||
|
||||
this.orientation == "h" && pref['sizeTop'] < this.dynheight.outerNode.height()) {
|
||||
options = jQuery.extend(options, pref);
|
||||
this.prefSize = pref[this.orientation == "v" ? 'sizeLeft' : 'sizeTop'];
|
||||
// Change from percent back to numeric
|
||||
if (typeof pref.sizeLeft !== "undefined") {
|
||||
pref.sizeLeft = ((parseFloat(pref.sizeLeft) / 100) * widget.dynheight.outerNode.width());
|
||||
}
|
||||
if (typeof pref.sizeTop !== "undefined") {
|
||||
pref.sizeTop = ((parseFloat(pref.sizeTop) / 100) * widget.dynheight.outerNode.height());
|
||||
}
|
||||
options = jQuery.extend(options, pref);
|
||||
this.prefSize = pref[this.orientation == "v" ? 'sizeLeft' : 'sizeTop'];
|
||||
}
|
||||
// If there is no preference yet, set it to half size
|
||||
// Otherwise the right pane gets the fullsize
|
||||
|
@ -219,12 +219,17 @@ class et2_split extends et2_DOMWidget implements et2_IResizeable, et2_IPrint
|
||||
let pref = this.egw().preference('splitter-size-' + this.id, this.egw().getAppName());
|
||||
if(pref)
|
||||
{
|
||||
if(this.orientation == "v" && pref['sizeLeft'] < this.dynheight.outerNode.width() ||
|
||||
this.orientation == "h" && pref['sizeTop'] < this.dynheight.outerNode.height())
|
||||
// Change from percent back to numeric
|
||||
if(typeof pref.sizeLeft !== "undefined")
|
||||
{
|
||||
options = jQuery.extend(options, pref);
|
||||
this.prefSize = pref[this.orientation == "v" ?'sizeLeft' : 'sizeTop'];
|
||||
pref.sizeLeft = ((parseFloat(pref.sizeLeft) / 100) * widget.dynheight.outerNode.width());
|
||||
}
|
||||
if(typeof pref.sizeTop !== "undefined")
|
||||
{
|
||||
pref.sizeTop = ((parseFloat(pref.sizeTop) / 100) * widget.dynheight.outerNode.height());
|
||||
}
|
||||
options = jQuery.extend(options, pref);
|
||||
this.prefSize = pref[this.orientation == "v" ? 'sizeLeft' : 'sizeTop'];
|
||||
}
|
||||
// If there is no preference yet, set it to half size
|
||||
// Otherwise the right pane gets the fullsize
|
||||
|
Loading…
Reference in New Issue
Block a user