Skip to content

Commit

Permalink
πŸš‘ [sap] fix SAP buttons in mission window when : has not supported
Browse files Browse the repository at this point in the history
(cherry picked from commit b92365a)
  • Loading branch information
jxn-30 committed Dec 11, 2023
1 parent 068acb8 commit 6484125
Showing 1 changed file with 23 additions and 5 deletions.
28 changes: 23 additions & 5 deletions src/modules/shareAlliancePost/assets/missionWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -554,10 +554,28 @@ export default async ({
)
);

Array.from(
document.querySelectorAll('.flex-row:has(~ #navbar-alarm-spacer)')
)
.at(-1)
?.after(btnGroup);
if (CSS.supports('selector(*:has(*))')) {
Array.from(
document.querySelectorAll(
'.flex-row:has(~ #navbar-alarm-spacer)'
)
)
.at(-1)
?.after(btnGroup);
} else {
const flexRows = Array.from(
document.querySelectorAll<HTMLDivElement>(
'#container_navbar_alarm .flex-row'
)
);
let i = 0;
for (const flexRow of flexRows) {
if (flexRow.matches('#navbar-alarm-spacer ~ .flex-row')) {
flexRows[i - 1]?.after(btnGroup);
continue;
}
i++;
}
}
}
};

0 comments on commit 6484125

Please sign in to comment.