cinera_search_pre.js: Compute grid on view toggle

This commit is contained in:
Matt Mascarenhas 2021-02-04 00:46:43 +00:00
parent f519a0977f
commit e7d70ccb3a
1 changed files with 22 additions and 0 deletions

View File

@ -3472,6 +3472,27 @@ ToggleView()
} }
else else
{ {
CineraProps.Orientation = GetRealOrientation(orientations.LANDSCAPE_LEFT, CineraProps.IsMobile);
if(CineraProps.IsMobile)
{
UseOrientation(CineraProps.Orientation);
}
var NewGridSize = ComputeOptimalGridSize();
if(Nav.GridSize !== NewGridSize)
{
UnbindGridKeys();
Nav.GridSize = NewGridSize;
ReinitButtons();
BindGridKeys();
SetHelpKeyAvailability(Nav.GridSize)
if(GridSizeIsSupported(Nav.GridSize))
{
var TargetLevel = Nav.TraversalStack[Nav.TraversalStack.length - 1];
var ProjectsStack = EmptyTraversalStackIntoProjectsStack();
DeriveTraversalStack(ProjectsStack, TargetLevel);
}
}
if(GridSizeIsSupported(Nav.GridSize)) if(GridSizeIsSupported(Nav.GridSize))
{ {
Nav.Controls.View.textContent = "View: Grid"; Nav.Controls.View.textContent = "View: Grid";
@ -3834,6 +3855,7 @@ ResizeFunction()
} }
UpdateButtons(); UpdateButtons();
} }
function function
InitResizeEventListener() InitResizeEventListener()
{ {