Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix errors on resize #205

Merged
merged 4 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions platform/src/EducationPlatformApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -532,11 +532,11 @@ class EducationPlatformApp {


fit() {

var splitter = document.getElementById("splitter");
splitter.style.minHeight = window.innerHeight + "px";
splitter.style.maxHeight = window.innerHeight + "px";

if (splitter){
splitter.style.minHeight = window.innerHeight + "px";
splitter.style.maxHeight = window.innerHeight + "px";
}
this.panels.forEach(panel => panel.fit());
this.preloader.hide();
}
Expand Down
12 changes: 9 additions & 3 deletions platform/src/Layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Layout {
var splitter;

if ( panels.length == 1 ) {
splitter = Layout.createVerticalSplitter([panels[0].getElement()]);
splitter = panels[0].getElement(); // only the element to add
szschaler marked this conversation as resolved.
Show resolved Hide resolved

} else if ( panels.length == 2 ) {
splitter = Layout.createVerticalSplitter([panels[0].getElement(), panels[1].getElement()], "50, 50" );
Expand All @@ -36,7 +36,7 @@ class Layout {

// Odd number of panels so add the last element
if (panelsToLayout.length==1){
verticalSplitters.push( Layout.createVerticalSplitter([panelsToLayout.pop().getElement()]) );
verticalSplitters.push(panelsToLayout.pop().getElement());
}

splitter = Layout.createHorizontalSplitter( verticalSplitters, splitProportions);
Expand Down Expand Up @@ -89,7 +89,13 @@ class Layout {

// Create the splitters for the row
let splitProportions = ("10, ".repeat(numberOfRows)); // Add a proportion per splitter
verticalSplitters.push ( Layout.createVerticalSplitter( panelsToLayout.map( pn => pn.getElement() ), splitProportions) );

if (panelsToLayout.length > 1) {
verticalSplitters.push( Layout.createVerticalSplitter( panelsToLayout.map( pn => pn.getElement() ), splitProportions) );
} else {
// No splitter required for a single panel
verticalSplitters.push( panelsToLayout[0].getElement() );
szschaler marked this conversation as resolved.
Show resolved Hide resolved
}
}

if (numberOfColumns > 1) {
Expand Down