diff --git a/templates/repo/diff/options_dropdown.tmpl b/templates/repo/diff/options_dropdown.tmpl index 8bb92c45fe028..93e1183d1b18f 100644 --- a/templates/repo/diff/options_dropdown.tmpl +++ b/templates/repo/diff/options_dropdown.tmpl @@ -1,7 +1,7 @@ -{{if .IsSplitStyle}}{{svg "gitea-join"}}{{else}}{{svg "gitea-split"}}{{end}} +{{if .IsSplitStyle}}{{svg "gitea-join"}}{{else}}{{svg "gitea-split"}}{{end}} diff --git a/templates/repo/settings/webhook/history.tmpl b/templates/repo/settings/webhook/history.tmpl index ff482846a79f0..e573d221d14be 100644 --- a/templates/repo/settings/webhook/history.tmpl +++ b/templates/repo/settings/webhook/history.tmpl @@ -18,7 +18,7 @@ {{else}} {{svg "octicon-alert"}} {{end}} - {{.UUID}} + {{.UUID}}
{{.DeliveredString}} diff --git a/web_src/js/features/common-global.js b/web_src/js/features/common-global.js index a061e53d8a9c1..96fa8a7dd2cac 100644 --- a/web_src/js/features/common-global.js +++ b/web_src/js/features/common-global.js @@ -118,10 +118,6 @@ export function initGlobalCommon() { $('.tabular.menu .item').tab(); - $('.toggle.button').on('click', function () { - toggleElem($($(this).data('target'))); - }); - // prevent multiple form submissions on forms containing .loading-button document.addEventListener('submit', (e) => { const btn = e.target.querySelector('.loading-button'); @@ -310,8 +306,15 @@ export function initGlobalButtons() { }); $('.show-panel.button').on('click', function (e) { + // a '.show-panel.button' can show a panel, by `data-panel="selector"` + // if the button is a "toggle" button, it toggles the panel e.preventDefault(); - showElem($(this).data('panel')); + const sel = $(this).attr('data-panel'); + if (this.classList.contains('toggle')) { + toggleElem(sel); + } else { + showElem(sel); + } }); $('.hide-panel.button').on('click', function (e) {