mirror of
https://github.com/go-gitea/gitea.git
synced 2025-07-18 17:22:56 +02:00
fix
This commit is contained in:
parent
fe656586f5
commit
459edfebcb
@ -5,7 +5,7 @@
|
|||||||
"CurrentRefType" .ctxData.RefFullName.RefType
|
"CurrentRefType" .ctxData.RefFullName.RefType
|
||||||
"CurrentRefShortName" .ctxData.RefFullName.ShortName
|
"CurrentRefShortName" .ctxData.RefFullName.ShortName
|
||||||
"CurrentTreePath" .ctxData.TreePath
|
"CurrentTreePath" .ctxData.TreePath
|
||||||
"RefLinkTemplate" "{RepoLink}/src/{RefTypeNameSubURL}/{TreePath}"
|
"RefLinkTemplate" "{RepoLink}/src/{RefType}/{RefShortName}/{TreePath}"
|
||||||
"AllowCreateNewRef" .ctxData.CanCreateBranch
|
"AllowCreateNewRef" .ctxData.CanCreateBranch
|
||||||
"ShowViewAllRefsEntry" true
|
"ShowViewAllRefsEntry" true
|
||||||
"ContainerClasses" .containerClasses
|
"ContainerClasses" .containerClasses
|
||||||
|
@ -155,15 +155,15 @@ function onShowModalClick(e) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function initGlobalButtons(): void {
|
export function initGlobalButtons(): void {
|
||||||
initTargetButtons(document as ParentNode);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function initTargetButtons(target: ParentNode): void {
|
|
||||||
// There are many "cancel button" elements in modal dialogs, Fomantic UI expects they are button-like elements but never submit a form.
|
// There are many "cancel button" elements in modal dialogs, Fomantic UI expects they are button-like elements but never submit a form.
|
||||||
// However, Gitea misuses the modal dialog and put the cancel buttons inside forms, so we must prevent the form submission.
|
// However, Gitea misuses the modal dialog and put the cancel buttons inside forms, so we must prevent the form submission.
|
||||||
// There are a few cancel buttons in non-modal forms, and there are some dynamically created forms (eg: the "Edit Issue Content")
|
// There are a few cancel buttons in non-modal forms, and there are some dynamically created forms (eg: the "Edit Issue Content")
|
||||||
queryElems(target, 'form button.ui.cancel.button', (el) => el.addEventListener('click', (e) => e.preventDefault()));
|
addDelegatedEventListener(document, 'click', 'form button.ui.cancel.button', (_ /* el */, e) => e.preventDefault());
|
||||||
|
|
||||||
|
initTargetButtons(document);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function initTargetButtons(target: ParentNode): void {
|
||||||
queryElems(target, '.show-panel', (el) => el.addEventListener('click', onShowPanelClick));
|
queryElems(target, '.show-panel', (el) => el.addEventListener('click', onShowPanelClick));
|
||||||
queryElems(target, '.hide-panel', (el) => el.addEventListener('click', onHidePanelClick));
|
queryElems(target, '.hide-panel', (el) => el.addEventListener('click', onHidePanelClick));
|
||||||
queryElems(target, '.show-modal', (el) => el.addEventListener('click', onShowModalClick));
|
queryElems(target, '.show-modal', (el) => el.addEventListener('click', onShowModalClick));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user