fix: sidebar navigation reset for github (#292)

fix #279

Co-authored-by: arlen.dp <arlen.dp@alibaba-inc.com>
This commit is contained in:
arlendp 2023-05-17 00:59:43 +08:00 committed by GitHub
parent a3cbf7587d
commit 8503595efd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -57,7 +57,7 @@ export function isInRepoPage() {
}
export function isInCodePage() {
const branchListSelector = ['#branch-select-menu', '.branch-select-menu'].join()
const branchListSelector = ['#branch-select-menu', '.branch-select-menu', 'button[id^=branch-picker]'].join()
// The element may still exist in DOM for PR pages, but not visible
return Boolean($(branchListSelector, e => e.offsetWidth > 0 && e.offsetHeight > 0))
}