mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-19 01:32:19 +00:00
Lay the right panels out again once the Stories card has faded in
The card fades in from transparent, and the right column skips transparent obstacles, so the layout run when the card arrived missed it and the column stayed under it until something else moved the panels. The end of the fade now lays the column out again; it also replays when the card is shown again after the loading screen, recording or clean view. Co-authored-by: Manjunath Paparaju <[email protected]>
This commit is contained in:
1 parent
f254c62704
commit
d211b9dfc0
1 file changed
+18
@@ -104,6 +104,8 @@ export class PanelLayoutController {
|
||||
this._rightStackReconsiderAutoCollapse = false;
|
||||
this._rightStackResizeObserver = null;
|
||||
this._storiesCardObserver = null;
|
||||
this._storiesCardShownHandler = null;
|
||||
this._storiesHost = null;
|
||||
this._cockpitLayoutFrame = null;
|
||||
this._cockpitLayoutTimer = null;
|
||||
this._leftPanelStack = document.getElementById('left-panel-stack');
|
||||
@@ -260,8 +262,12 @@ export class PanelLayoutController {
|
||||
});
|
||||
// The Stories card comes and goes inside the Stories view; only its
|
||||
// arrival or departure moves the rail, not the view's other changes.
|
||||
// It fades in from transparent, which the layout skips, so the end of
|
||||
// that fade (also replayed when the card is shown again after being
|
||||
// hidden) lays the rail out once more.
|
||||
const storiesHost = document.getElementById('gev-stories-host');
|
||||
if (storiesHost) {
|
||||
this._storiesHost = storiesHost;
|
||||
this._storiesCardObserver = new MutationObserver((records) => {
|
||||
if (records.some(movesStoriesCard)) this._scheduleRightPanelLayout();
|
||||
});
|
||||
@@ -269,6 +275,13 @@ export class PanelLayoutController {
|
||||
subtree: true,
|
||||
childList: true,
|
||||
});
|
||||
this._storiesCardShownHandler = (event) => {
|
||||
if (event.target?.id === 'hPop') this._scheduleRightPanelLayout();
|
||||
};
|
||||
storiesHost.addEventListener(
|
||||
'animationend',
|
||||
this._storiesCardShownHandler,
|
||||
);
|
||||
}
|
||||
const hud = document.getElementById('intel-hud');
|
||||
if (hud) {
|
||||
@@ -493,6 +506,11 @@ export class PanelLayoutController {
|
||||
this[field]?.disconnect();
|
||||
this[field] = null;
|
||||
}
|
||||
this._storiesHost?.removeEventListener(
|
||||
'animationend',
|
||||
this._storiesCardShownHandler,
|
||||
);
|
||||
this._storiesHost = this._storiesCardShownHandler = null;
|
||||
for (const field of [
|
||||
'_leftStackHudTransitionHandler',
|
||||
'_rightStackHudTransitionHandler',
|
||||
|
||||
Reference in new issue
Block a user