From f1e20846f54dd03214d567b31eb678b30aff8975 Mon Sep 17 00:00:00 2001 From: Franck Villaume Date: Mon, 6 Dec 2021 16:21:29 +0100 Subject: [PATCH] javascript clean-up --- src/www/docman/scripts/DocManController.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/www/docman/scripts/DocManController.js b/src/www/docman/scripts/DocManController.js index 901964a4b3..c98b136833 100644 --- a/src/www/docman/scripts/DocManController.js +++ b/src/www/docman/scripts/DocManController.js @@ -84,7 +84,11 @@ DocManListFileController.prototype = splitterPosition = Math.round(storedSplitterPosition * 100 / mainwidth )+'%'; } if (this.listfileparams.page == 'trashfile') { - (this.listfileparams.divLeft.outerHeight() > this.listfileparams.divRight.outerHeight()) ? mainheight = this.listfileparams.divLeft.outerHeight() : mainheight = this.listfileparams.divRight.outerHeight(); + if (this.listfileparams.divLeft.outerHeight() > this.listfileparams.divRight.outerHeight()) { + mainheight = this.listfileparams.divLeft.outerHeight(); + } else { + mainheight = this.listfileparams.divRight.outerHeight(); + } } else { var fixwidth = -40; var useRightHeight; @@ -101,11 +105,19 @@ DocManListFileController.prototype = } }); totalRightHeight -= fixwidth; - (this.listfileparams.divRight.outerHeight() - fixwidth < 0) ? useRightHeight = this.listfileparams.divRight.outerHeight() : useRightHeight = this.listfileparams.divRight.outerHeight() - fixwidth; + if (this.listfileparams.divRight.outerHeight() - fixwidth < 0) { + useRightHeight = this.listfileparams.divRight.outerHeight(); + } else { + useRightHeight = this.listfileparams.divRight.outerHeight() - fixwidth; + } if (useRightHeight < totalRightHeight) { useRightHeight = totalRightHeight; } - (this.listfileparams.divLeft.outerHeight() + 30 > this.listfileparams.divRight.outerHeight()) ? mainheight = this.listfileparams.divLeft.outerHeight() + 30 : mainheight = useRightHeight; + if (this.listfileparams.divLeft.outerHeight() + 30 > this.listfileparams.divRight.outerHeight()) { + mainheight = this.listfileparams.divLeft.outerHeight() + 30; + } else { + mainheight = useRightHeight; + } } jQuery('#views').height(mainheight) .split({orientation:'vertical', limit:100, position: splitterPosition}); -- 2.30.2