fix: align market selection checkboxes
This commit is contained in:
@@ -2682,9 +2682,7 @@ function installPaginationHarness(
|
||||
}
|
||||
|
||||
const renderPage = () => {
|
||||
const authorColumn = document.querySelector(
|
||||
'[data-testid="author-section"] .content-column'
|
||||
) as HTMLElement | null;
|
||||
const authorColumn = readAuthorContentColumn();
|
||||
const middleColumn = document.querySelector(
|
||||
'.middle-columns .content-column'
|
||||
) as HTMLElement | null;
|
||||
@@ -2777,9 +2775,7 @@ function installAsyncPaginationHarness(
|
||||
};
|
||||
|
||||
const renderPage = () => {
|
||||
const authorColumn = document.querySelector(
|
||||
'[data-testid="author-section"] .content-column'
|
||||
) as HTMLElement | null;
|
||||
const authorColumn = readAuthorContentColumn();
|
||||
const middleColumn = document.querySelector(
|
||||
'.middle-columns .content-column'
|
||||
) as HTMLElement | null;
|
||||
@@ -2883,9 +2879,7 @@ function installLaggyPaginationHarness(
|
||||
};
|
||||
|
||||
const renderPage = () => {
|
||||
const authorColumn = document.querySelector(
|
||||
'[data-testid="author-section"] .content-column'
|
||||
) as HTMLElement | null;
|
||||
const authorColumn = readAuthorContentColumn();
|
||||
const middleColumn = document.querySelector(
|
||||
'.middle-columns .content-column'
|
||||
) as HTMLElement | null;
|
||||
@@ -2940,9 +2934,7 @@ function installLaggyPaginationHarness(
|
||||
pageIndex += 1;
|
||||
updatePaginationState(pageIndex);
|
||||
|
||||
const authorColumn = document.querySelector(
|
||||
'[data-testid="author-section"] .content-column'
|
||||
) as HTMLElement | null;
|
||||
const authorColumn = readAuthorContentColumn();
|
||||
const middleColumn = document.querySelector(
|
||||
'.middle-columns .content-column'
|
||||
) as HTMLElement | null;
|
||||
@@ -3014,9 +3006,7 @@ function installProgressivePaginationHarness(
|
||||
price21To60s: string;
|
||||
}>
|
||||
) => {
|
||||
const authorColumn = document.querySelector(
|
||||
'[data-testid="author-section"] .content-column'
|
||||
) as HTMLElement | null;
|
||||
const authorColumn = readAuthorContentColumn();
|
||||
const middleColumn = document.querySelector(
|
||||
'.middle-columns .content-column'
|
||||
) as HTMLElement | null;
|
||||
@@ -3118,9 +3108,7 @@ function installLazyFieldHydrationHarness(options: {
|
||||
const rightColumns = document.querySelectorAll(
|
||||
'[data-testid="right-section"] > .content-column'
|
||||
);
|
||||
const authorCells = Array.from(
|
||||
document.querySelectorAll('[data-testid="author-section"] .content-column .content-cell')
|
||||
) as HTMLElement[];
|
||||
const authorCells = readAuthorContentCells();
|
||||
const middleCells = Array.from(
|
||||
document.querySelectorAll(".middle-columns .content-column .content-cell")
|
||||
) as HTMLElement[];
|
||||
@@ -3288,11 +3276,7 @@ function installPagedLazyFieldHydrationHarness(options: {
|
||||
const rightColumns = document.querySelectorAll(
|
||||
'[data-testid="right-section"] > .content-column'
|
||||
);
|
||||
const authorCells = Array.from(
|
||||
document.querySelectorAll(
|
||||
'[data-testid="author-section"] .content-column .content-cell'
|
||||
)
|
||||
) as HTMLElement[];
|
||||
const authorCells = readAuthorContentCells();
|
||||
const middleCells = Array.from(
|
||||
document.querySelectorAll(".middle-columns .content-column .content-cell")
|
||||
) as HTMLElement[];
|
||||
@@ -3531,14 +3515,40 @@ function readRowOrder() {
|
||||
}
|
||||
|
||||
function readDivAuthorOrder() {
|
||||
const authorColumn = document.querySelector(
|
||||
'[data-testid="author-section"] .content-column'
|
||||
);
|
||||
const authorColumn = readAuthorContentColumn();
|
||||
return readVisualCells(authorColumn).map(
|
||||
(cell) => cell.querySelector("a")?.textContent?.trim() ?? ""
|
||||
);
|
||||
}
|
||||
|
||||
function readAuthorContentColumn(): HTMLElement | null {
|
||||
const nativeColumns = Array.from(
|
||||
document.querySelectorAll('[data-testid="author-section"] > .content-column')
|
||||
).filter(
|
||||
(column): column is HTMLElement =>
|
||||
column instanceof HTMLElement && !column.dataset.marketColumnGroup
|
||||
);
|
||||
if (nativeColumns.length === 1) {
|
||||
return nativeColumns[0];
|
||||
}
|
||||
|
||||
return (
|
||||
nativeColumns.find((column) =>
|
||||
Boolean(
|
||||
column.querySelector('a[href*="/author-homepage/"]') ||
|
||||
column.querySelector(".author-nickname") ||
|
||||
column.querySelector("[data-testid^='author-cell-']")
|
||||
)
|
||||
) ?? null
|
||||
);
|
||||
}
|
||||
|
||||
function readAuthorContentCells(): HTMLElement[] {
|
||||
return Array.from(
|
||||
readAuthorContentColumn()?.querySelectorAll(":scope > .content-cell") ?? []
|
||||
).filter((cell): cell is HTMLElement => cell instanceof HTMLElement);
|
||||
}
|
||||
|
||||
function readDivRightRowTexts(rowIndex: number) {
|
||||
return Array.from(
|
||||
document.querySelectorAll('[data-testid="right-section"] > .content-column'),
|
||||
|
||||
Reference in New Issue
Block a user