mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
fix: add PJAX container fallback logic
This commit is contained in:
parent
ed35566931
commit
73adbf0310
1 changed files with 6 additions and 1 deletions
|
|
@ -106,6 +106,11 @@ function resolvePageScope(defaultBranchName?: string) {
|
|||
|
||||
const pathSHAMap = new Map<string, string>()
|
||||
|
||||
// Try lookup PJAX containers, #js-repo-pjax-container could exist while #repo-content-pjax-container does not.
|
||||
const pjaxContainerSelector = ['#repo-content-pjax-container', '#js-repo-pjax-container'].find(
|
||||
selector => document.querySelector(selector),
|
||||
)
|
||||
|
||||
export const GitHub: Platform = {
|
||||
isEnterprise,
|
||||
resolvePartialMetaData() {
|
||||
|
|
@ -201,7 +206,7 @@ export const GitHub: Platform = {
|
|||
delegatePJAXProps(options) {
|
||||
if (!options?.node || options.node.type === 'blob')
|
||||
return {
|
||||
'data-pjax': '#repo-content-pjax-container, #js-repo-pjax-container',
|
||||
'data-pjax': pjaxContainerSelector,
|
||||
onClick() {
|
||||
/* Overwriting default onClick */
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue