mirror of
https://github.com/go-gitea/gitea.git
synced 2025-07-20 10:28:36 +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;
|
const {i18n} = window.config;
|
||||||
|
|
||||||
export function initCopyContent() {
|
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;
|
if (!btn || btn.classList.contains('disabled')) return;
|
||||||
|
|
||||||
btn.addEventListener('click', async () => {
|
btn.addEventListener('click', async () => {
|
||||||
|
@ -7,6 +7,7 @@ import {initTargetDropdown} from './common-page.ts';
|
|||||||
import {initTargetRepoEllipsisButton} from './repo-commit.ts';
|
import {initTargetRepoEllipsisButton} from './repo-commit.ts';
|
||||||
import {initTargetPdfViewer} from '../render/pdf.ts';
|
import {initTargetPdfViewer} from '../render/pdf.ts';
|
||||||
import {initTargetButtons} from './common-button.ts';
|
import {initTargetButtons} from './common-button.ts';
|
||||||
|
import {initTargetCopyContent} from './copycontent.ts';
|
||||||
|
|
||||||
async function toggleSidebar(visibility, isSigned) {
|
async function toggleSidebar(visibility, isSigned) {
|
||||||
const sidebarEl = document.querySelector('.repo-view-file-tree-sidebar');
|
const sidebarEl = document.querySelector('.repo-view-file-tree-sidebar');
|
||||||
@ -62,6 +63,7 @@ function reloadContentScript(contentEl: Element) {
|
|||||||
initTargetPdfViewer(contentEl);
|
initTargetPdfViewer(contentEl);
|
||||||
initTargetRepoBranchTagSelector(contentEl);
|
initTargetRepoBranchTagSelector(contentEl);
|
||||||
initTargetRepoEllipsisButton(contentEl);
|
initTargetRepoEllipsisButton(contentEl);
|
||||||
|
initTargetCopyContent(contentEl);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function initViewFileTreeSidebar() {
|
export async function initViewFileTreeSidebar() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user