mirror of
https://github.com/samuelthomas2774/nxapi.git
synced 2026-03-21 18:04:10 -05:00
Hide unnecessary scrollbars in SplatNet 3
https://github.com/samuelthomas2774/nxapi/issues/24
This commit is contained in:
parent
6f84981018
commit
e5fe9b389e
|
|
@ -988,7 +988,7 @@ export interface VsHistoryDetailPagerRefetchQueryResult {
|
|||
id: string;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/** cd82f2ade8aca7687947c5f3210805a6 VsHistoryDetailQuery */
|
||||
export interface VsHistoryDetailResult {
|
||||
vsHistoryDetail: VsHistoryDetail;
|
||||
|
|
|
|||
|
|
@ -6,6 +6,21 @@ const debug = createDebug('app:preload-webservice:quirks:splatnet2');
|
|||
const SPLATNET2_WEBSERVICE_ID = 5741031244955648;
|
||||
|
||||
if (webservice.id === SPLATNET2_WEBSERVICE_ID) {
|
||||
const style = window.document.createElement('style');
|
||||
|
||||
style.textContent = `
|
||||
.popup-dim {
|
||||
/* Hide the horizonal scroll bar that only appears during the popup animation */
|
||||
overflow-x: hidden;
|
||||
}
|
||||
`;
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
// Always show the scroll bar for the document root since no scrollable containers are used anywhere
|
||||
(document.scrollingElement as HTMLElement).style.overflowY = 'scroll';
|
||||
window.document.head.appendChild(style);
|
||||
});
|
||||
|
||||
events.on('window:refresh', () => {
|
||||
const refresh_button = document.querySelector<HTMLElement>('.refresh-button');
|
||||
|
||||
|
|
|
|||
|
|
@ -12,12 +12,31 @@ if (webservice.id === SPLATNET3_WEBSERVICE_ID) {
|
|||
[class*=NavigationBar_exitButton] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
[class*=App_App] {
|
||||
/* Hide scroll bars in the main app container, which includes the title bar that should always be fixed */
|
||||
overflow: auto;
|
||||
}
|
||||
[class*=InAppContent_children] {
|
||||
/* Maybe hide scroll bars in the main content container */
|
||||
overflow-y: auto;
|
||||
/* Hide the horizonal scroll bar that only appears during the page sliding transition */
|
||||
overflow-x: hidden;
|
||||
}
|
||||
[class*=SwipableView_swipableViewItem] {
|
||||
/* Maybe hide scroll bars in swipable views (e.g. in the schedules page) */
|
||||
overflow-y: auto;
|
||||
}
|
||||
[class*=StyledModal_Container] {
|
||||
/* Maybe hide the scroll bar in modals */
|
||||
overflow-y: auto;
|
||||
}
|
||||
`;
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
window.document.head.appendChild(style);
|
||||
});
|
||||
|
||||
|
||||
events.on('window:refresh', () => {
|
||||
const pulltorefresh_container = document.querySelector<HTMLElement>('[class*=PullToRefresh_container]');
|
||||
debug('PullToRefresh container HTMLElement', pulltorefresh_container);
|
||||
|
|
@ -27,7 +46,7 @@ if (webservice.id === SPLATNET3_WEBSERVICE_ID) {
|
|||
const react_fiber: any = pulltorefresh_container[keys.find(k => k.startsWith('__reactFiber$'))!];
|
||||
debug('PullToRefresh container React fiber', react_fiber);
|
||||
if (!react_fiber) return location.reload();
|
||||
|
||||
|
||||
try {
|
||||
const props = react_fiber.return.return.memoizedProps;
|
||||
debug('PullToRefresh root props', props);
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ export default class Users<T extends UserData> {
|
|||
]);
|
||||
|
||||
const user = new CoralUser(nso, data, announcements, friends, webservices, active_event);
|
||||
|
||||
|
||||
if (store) {
|
||||
await maybeUpdateWebServicesListCache(cached_webservices, store, data.user, webservices);
|
||||
user.onUpdatedWebServices = webservices => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user