Revert "Fix splitter widget did not restore size from preference"

This reverts commit e8635be8c1.
This commit is contained in:
ralf 2022-03-30 10:21:22 +03:00
parent 812e2a4b31
commit e7dc51ad14
2 changed files with 81 additions and 92 deletions

View File

@ -161,12 +161,10 @@ export class et2_split extends et2_DOMWidget implements et2_IResizeable, et2_IPr
super.doLoadingFinished();
// Not done yet, but widget will let you know
let p = new Promise((resolve) =>
{
return new Promise((resolve) => {
// Use a timeout to give the children a chance to finish
window.setTimeout(() => this._init_splitter(resolve), 1);
window.setTimeout(() => this._init_splitter(resolve),1);
});
return p;
}
/**
@ -218,17 +216,12 @@ export class et2_split extends et2_DOMWidget implements et2_IResizeable, et2_IPr
let pref = this.egw().preference('splitter-size-' + this.id, this.egw().getAppName());
if(pref)
{
// Change from percent back to numeric
if(typeof pref.sizeLeft !== "undefined")
if(this.orientation == "v" && pref['sizeLeft'] < this.dynheight.outerNode.width() ||
this.orientation == "h" && pref['sizeTop'] < this.dynheight.outerNode.height())
{
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'];
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

View File

@ -646,10 +646,7 @@ export class etemplate2
egw.window.console.groupEnd();
}
// Wait for everything to be loaded, then finish it up. Use timeout to give anything else a chance
// to run.
setTimeout(() =>
{
// Wait for everything to be loaded, then finish it up
Promise.all(deferred).then(() =>
{
egw.debug("log", "Finished loading %s, triggering load event", _name);
@ -737,7 +734,6 @@ export class etemplate2
gen_time_div.append('<span class="et2RenderTime">' + egw.lang('eT2 rendering took %1s', '' + ((end_time - start_time) / 1000)) + '</span>');
}
});
});
};