From 067ca9ab1620744cc83b412f13d57807c9dbe9c9 Mon Sep 17 00:00:00 2001 From: zadam Date: Mon, 8 Feb 2021 20:51:38 +0100 Subject: [PATCH] fallback for incorrectly parsed pane widths, #1621 --- src/public/app/services/split.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/public/app/services/split.js b/src/public/app/services/split.js index 115185685..2512eaae3 100644 --- a/src/public/app/services/split.js +++ b/src/public/app/services/split.js @@ -14,8 +14,17 @@ function setupSplit(left, right) { return; } - const leftPaneWidth = options.getInt('leftPaneWidth'); - const rightPaneWidth = options.getInt('rightPaneWidth'); + let leftPaneWidth = options.getInt('leftPaneWidth'); + if (!leftPaneWidth || leftPaneWidth < 5) { + leftPaneWidth = 5; + } + + let rightPaneWidth = options.getInt('rightPaneWidth'); + if (!rightPaneWidth || rightPaneWidth < 5) { + rightPaneWidth = 5; + } + + console.log(leftPaneWidth, rightPaneWidth); if (left && right) { instance = Split(['#left-pane', '#center-pane', '#right-pane'], { @@ -49,4 +58,4 @@ function setupSplit(left, right) { export default { setupSplit -}; \ No newline at end of file +};