Avoiding flickering when entering presentation mode with no presentation
This commit is contained in:
parent
044495cf05
commit
7f5f802b86
1 changed files with 2 additions and 14 deletions
|
@ -208,8 +208,8 @@ class LayoutManager {
|
||||||
const mainSectionChildren = Array.from(document.querySelectorAll<HTMLDivElement>('div.main-section > div').values());
|
const mainSectionChildren = Array.from(document.querySelectorAll<HTMLDivElement>('div.main-section > div').values());
|
||||||
const sidebarChildren = Array.from(document.querySelectorAll<HTMLDivElement>('aside.sidebar > div').values());
|
const sidebarChildren = Array.from(document.querySelectorAll<HTMLDivElement>('aside.sidebar > div').values());
|
||||||
|
|
||||||
// Nothing? Let's center
|
// No presentation? Let's center on the screen
|
||||||
if (mainSectionChildren.length === 0 && sidebarChildren.length === 0) {
|
if (mainSectionChildren.length === 0) {
|
||||||
return {
|
return {
|
||||||
xStart: 0,
|
xStart: 0,
|
||||||
yStart: 0,
|
yStart: 0,
|
||||||
|
@ -218,18 +218,6 @@ class LayoutManager {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mainSectionChildren.length === 0) {
|
|
||||||
const lastSidebarDiv = sidebarChildren[sidebarChildren.length-1];
|
|
||||||
|
|
||||||
// No presentation? Let's center on the main-section space
|
|
||||||
return {
|
|
||||||
xStart: 0,
|
|
||||||
yStart: 0,
|
|
||||||
xEnd: lastSidebarDiv.offsetLeft,
|
|
||||||
yEnd: window.innerHeight
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// At this point, we know we have at least one element in the main section.
|
// At this point, we know we have at least one element in the main section.
|
||||||
const lastPresentationDiv = mainSectionChildren[mainSectionChildren.length-1];
|
const lastPresentationDiv = mainSectionChildren[mainSectionChildren.length-1];
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue