mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
fix: update DOM selectors
This commit is contained in:
parent
8ae4834d67
commit
6043fe79ec
1 changed files with 5 additions and 2 deletions
|
|
@ -6,12 +6,15 @@ import { renderReact } from 'utils/general'
|
|||
import { CopyFileButton, copyFileButtonClassName } from './CopyFileButton'
|
||||
|
||||
export function isInCodePage() {
|
||||
const branchListSelector = '#branch-select-menu.branch-select-menu'
|
||||
const branchListSelector = ['#branch-select-menu', '.branch-select-menu'].join()
|
||||
return Boolean($(branchListSelector))
|
||||
}
|
||||
|
||||
export function getCurrentBranch() {
|
||||
const selectedBranchButtonSelector = '.repository-content .branch-select-menu summary'
|
||||
const selectedBranchButtonSelector = [
|
||||
'.repository-content #branch-select-menu summary',
|
||||
'.repository-content .branch-select-menu summary',
|
||||
].join()
|
||||
const branchButtonElement: HTMLElement = $(selectedBranchButtonSelector)
|
||||
if (branchButtonElement) {
|
||||
const branchNameSpanElement = branchButtonElement.querySelector('span')
|
||||
|
|
|
|||
Loading…
Reference in a new issue