mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
fix: attach copy buttons when navigate through GitHub PJAX
This commit is contained in:
parent
d818e5ccc2
commit
fbc67c68f4
1 changed files with 2 additions and 0 deletions
|
|
@ -302,6 +302,7 @@ export function useGitHubAttachCopySnippetButton(copySnippetButton: boolean) {
|
|||
)
|
||||
React.useEffect(attachCopySnippetButton, [copySnippetButton])
|
||||
useEvent('pjax:ready', attachCopySnippetButton, document)
|
||||
useEvent('pjax:end', attachCopySnippetButton, document) // GitHub emits pjax:end when navigate through its file list
|
||||
}
|
||||
|
||||
export function useGitHubAttachCopyFileButton(copyFileButton: boolean) {
|
||||
|
|
@ -314,4 +315,5 @@ export function useGitHubAttachCopyFileButton(copyFileButton: boolean) {
|
|||
)
|
||||
React.useEffect(attachCopyFileButton, [copyFileButton])
|
||||
useEvent('pjax:ready', attachCopyFileButton, document)
|
||||
useEvent('pjax:end', attachCopyFileButton, document) // GitHub emits pjax:end when navigate through its file list
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue