mirror of
https://github.com/go-gitea/gitea.git
synced 2025-07-20 23:28:28 +02:00
fix
This commit is contained in:
parent
dc63b48493
commit
fe212908b1
@ -6,7 +6,11 @@ import {GET} from '../modules/fetch.ts';
|
||||
const {i18n} = window.config;
|
||||
|
||||
export function initCopyContent() {
|
||||
const btn = document.querySelector('#copy-content');
|
||||
initTargetCopyContent(document);
|
||||
}
|
||||
|
||||
export function initTargetCopyContent(target: ParentNode) {
|
||||
const btn = target.querySelector('#copy-content');
|
||||
if (!btn || btn.classList.contains('disabled')) return;
|
||||
|
||||
btn.addEventListener('click', async () => {
|
||||
|
@ -7,6 +7,7 @@ import {initTargetDropdown} from './common-page.ts';
|
||||
import {initTargetRepoEllipsisButton} from './repo-commit.ts';
|
||||
import {initTargetPdfViewer} from '../render/pdf.ts';
|
||||
import {initTargetButtons} from './common-button.ts';
|
||||
import {initTargetCopyContent} from './copycontent.ts';
|
||||
|
||||
async function toggleSidebar(visibility, isSigned) {
|
||||
const sidebarEl = document.querySelector('.repo-view-file-tree-sidebar');
|
||||
@ -62,6 +63,7 @@ function reloadContentScript(contentEl: Element) {
|
||||
initTargetPdfViewer(contentEl);
|
||||
initTargetRepoBranchTagSelector(contentEl);
|
||||
initTargetRepoEllipsisButton(contentEl);
|
||||
initTargetCopyContent(contentEl);
|
||||
}
|
||||
|
||||
export async function initViewFileTreeSidebar() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user