cinera_search_pre.js: Fix scrolling bug

This commit fixes ResizeFunction() to scroll back to the original Y
position, rather than the nexus (i.e. the grid or list), after resizing
the grid as a result of the window having been resized.
This commit is contained in:
Matt Mascarenhas 2023-01-10 12:39:06 +00:00
parent e8ed2f0143
commit 554f7393ff
2 changed files with 4 additions and 2 deletions

View File

@ -23,7 +23,7 @@ typedef struct
version CINERA_APP_VERSION = {
.Major = 0,
.Minor = 10,
.Patch = 18
.Patch = 19
};
#define __USE_XOPEN2K8 // NOTE(matt): O_NOFOLLOW

View File

@ -3817,6 +3817,8 @@ PseudoPushButton(Button)
function
ResizeFunction()
{
var OriginalScrollX = scrollX;
var OriginalScrollY = scrollY;
CineraProps.Orientation = GetRealOrientation(orientations.LANDSCAPE_LEFT, CineraProps.IsMobile);
if(CineraProps.IsMobile)
{
@ -3841,7 +3843,7 @@ ResizeFunction()
PickListView();
// TODO(matt): Inform user that we've switched to the list view
}
ScrollToWithOffset(Nav.Nexus, 0);
scroll(OriginalScrollX, OriginalScrollY);
}
UpdateButtons();
}