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