Fixed Split.js issues when resizing to around 1000px wide

This commit is contained in:
n1474335 2022-05-30 22:53:17 +01:00
parent ff99436ce6
commit 668eac1f9e
6 changed files with 81 additions and 9 deletions

View file

@ -57,7 +57,7 @@ class App {
this.populateOperationsList();
this.manager.setup();
this.manager.output.saveBombe();
this.resetLayout();
this.adjustComponentSizes();
this.setCompileMessage();
log.debug("App loaded");
@ -295,9 +295,7 @@ class App {
gutterSize: 4,
expandToMin: true,
onDrag: debounce(function() {
this.manager.recipe.adjustWidth();
this.manager.input.calcMaxTabs();
this.manager.output.calcMaxTabs();
this.adjustComponentSizes();
}, 50, "dragSplitter", this, [])
});
@ -307,7 +305,7 @@ class App {
minSize: minimise ? [0, 0] : [100, 100]
});
this.resetLayout();
this.adjustComponentSizes();
}
@ -581,6 +579,13 @@ class App {
resetLayout() {
this.columnSplitter.setSizes([20, 30, 50]);
this.ioSplitter.setSizes([50, 50]);
this.adjustComponentSizes();
}
/**
* Adjust components to fit their containers.
*/
adjustComponentSizes() {
this.manager.recipe.adjustWidth();
this.manager.input.calcMaxTabs();
this.manager.output.calcMaxTabs();

View file

@ -39,8 +39,8 @@ div#output {
.split {
box-sizing: border-box;
/* overflow: auto;
Removed to enable Background Magic button pulse to overflow.
/* overflow: auto; */
/* Removed to enable Background Magic button pulse to overflow.
Replace this rule if it seems to be causing problems. */
position: relative;
}

View file

@ -23,11 +23,11 @@ class WindowWaiter {
/**
* Handler for window resize events.
* Resets the layout of CyberChef's panes after 200ms (so that continuous resizing doesn't cause
* Resets adjustable component sizes after 200ms (so that continuous resizing doesn't cause
* continuous resetting).
*/
windowResize() {
debounce(this.app.resetLayout, 200, "windowResize", this.app, [])();
debounce(this.app.adjustComponentSizes, 200, "windowResize", this.app, [])();
}