Skip to content

Commit 7657e9d

Browse files
committed
Merge remote-tracking branch 'giteaofficial/main'
* giteaofficial/main: Adjust appearence of commit status webhook (go-gitea#33778) Refactor initRepoBranchTagSelector to use new init framework (go-gitea#33776) Refactor buttons to use new init framework (go-gitea#33774) Refactor markup and pdf-viewer to use new init framework (go-gitea#33772)
2 parents dd5b24d + ffb2765 commit 7657e9d

39 files changed

+254
-274
lines changed

services/webhook/general.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ import (
99
"net/url"
1010
"strings"
1111

12+
user_model "code.gitea.io/gitea/models/user"
1213
webhook_model "code.gitea.io/gitea/models/webhook"
14+
"code.gitea.io/gitea/modules/base"
1315
"code.gitea.io/gitea/modules/setting"
1416
api "code.gitea.io/gitea/modules/structs"
1517
"code.gitea.io/gitea/modules/util"
@@ -308,12 +310,16 @@ func getPackagePayloadInfo(p *api.PackagePayload, linkFormatter linkFormatter, w
308310
}
309311

310312
func getStatusPayloadInfo(p *api.CommitStatusPayload, linkFormatter linkFormatter, withSender bool) (text string, color int) {
311-
refLink := linkFormatter(p.TargetURL, p.Context+"["+p.SHA+"]:"+p.Description)
313+
refLink := linkFormatter(p.TargetURL, fmt.Sprintf("%s [%s]", p.Context, base.ShortSha(p.SHA)))
312314

313-
text = fmt.Sprintf("Commit Status changed: %s", refLink)
315+
text = fmt.Sprintf("Commit Status changed: %s - %s", refLink, p.Description)
314316
color = greenColor
315317
if withSender {
316-
text += fmt.Sprintf(" by %s", linkFormatter(setting.AppURL+url.PathEscape(p.Sender.UserName), p.Sender.UserName))
318+
if user_model.IsGiteaActionsUserName(p.Sender.UserName) {
319+
text += fmt.Sprintf(" by %s", p.Sender.FullName)
320+
} else {
321+
text += fmt.Sprintf(" by %s", linkFormatter(setting.AppURL+url.PathEscape(p.Sender.UserName), p.Sender.UserName))
322+
}
317323
}
318324

319325
return text, color

services/webhook/matrix.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import (
1515
"strings"
1616

1717
webhook_model "code.gitea.io/gitea/models/webhook"
18+
"code.gitea.io/gitea/modules/base"
1819
"code.gitea.io/gitea/modules/git"
1920
"code.gitea.io/gitea/modules/json"
2021
"code.gitea.io/gitea/modules/log"
@@ -245,8 +246,8 @@ func (m matrixConvertor) Package(p *api.PackagePayload) (MatrixPayload, error) {
245246
}
246247

247248
func (m matrixConvertor) Status(p *api.CommitStatusPayload) (MatrixPayload, error) {
248-
refLink := htmlLinkFormatter(p.TargetURL, p.Context+"["+p.SHA+"]:"+p.Description)
249-
text := fmt.Sprintf("Commit Status changed: %s", refLink)
249+
refLink := htmlLinkFormatter(p.TargetURL, fmt.Sprintf("%s [%s]", p.Context, base.ShortSha(p.SHA)))
250+
text := fmt.Sprintf("Commit Status changed: %s - %s", refLink, p.Description)
250251

251252
return m.newPayload(text)
252253
}

templates/org/home.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<div class="ui mobile reversed stackable grid">
77
<div class="ui {{if .ShowMemberAndTeamTab}}eleven wide{{end}} column">
88
{{if .ProfileReadmeContent}}
9-
<div id="readme_profile" class="markup" data-profile-view-as-member="{{.IsViewingOrgAsMember}}">{{.ProfileReadmeContent}}</div>
9+
<div id="readme_profile" class="render-content markup" data-profile-view-as-member="{{.IsViewingOrgAsMember}}">{{.ProfileReadmeContent}}</div>
1010
{{end}}
1111
{{template "shared/repo_search" .}}
1212
{{template "explore/repo_list" .}}

templates/projects/list.tmpl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,7 @@
7474
{{end}}
7575
</div>
7676
{{if .Description}}
77-
<div class="content">
78-
{{.RenderedContent}}
79-
</div>
77+
<div class="render-content markup">{{.RenderedContent}}</div>
8078
{{end}}
8179
</li>
8280
{{end}}

templates/repo/branch_dropdown.tmpl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414

1515
Search "repo/branch_dropdown" in the template directory to find all occurrences.
1616
*/}}
17-
<div class="js-branch-tag-selector {{if .ContainerClasses}}{{.ContainerClasses}}{{end}}"
17+
<div class="{{if .ContainerClasses}}{{.ContainerClasses}}{{end}}"
18+
data-global-init="initRepoBranchTagSelector"
1819
data-text-release-compare="{{ctx.Locale.Tr "repo.release.compare"}}"
1920
data-text-branches="{{ctx.Locale.Tr "repo.branches"}}"
2021
data-text-tags="{{ctx.Locale.Tr "repo.tags"}}"

templates/repo/commits_list.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
{{end}}
4949
</span>
5050
{{if IsMultilineCommitMessage .Message}}
51-
<button class="ui button js-toggle-commit-body ellipsis-button" aria-expanded="false">...</button>
51+
<button class="ui button ellipsis-button" aria-expanded="false" data-global-click="onRepoEllipsisButtonClick">...</button>
5252
{{end}}
5353
{{template "repo/commit_statuses" dict "Status" .Status "Statuses" .Statuses}}
5454
{{if IsMultilineCommitMessage .Message}}

templates/repo/editor/edit.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@
4545
data-line-wrap-extensions="{{.LineWrapExtensions}}">{{.FileContent}}</textarea>
4646
<div class="editor-loading is-loading"></div>
4747
</div>
48-
<div class="ui tab markup tw-px-4 tw-py-3" data-tab="preview">
48+
<div class="ui tab tw-px-4 tw-py-3" data-tab="preview">
4949
{{ctx.Locale.Tr "loading"}}
5050
</div>
51-
<div class="ui tab diff edit-diff" data-tab="diff">
51+
<div class="ui tab" data-tab="diff">
5252
<div class="tw-p-16"></div>
5353
</div>
5454
</div>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<div class="field {{if not .item.VisibleOnForm}}tw-hidden{{end}}">
2-
<div class="markup">{{ctx.RenderUtils.MarkdownToHtml .item.Attributes.value}}</div>
2+
<div class="render-content markup">{{ctx.RenderUtils.MarkdownToHtml .item.Attributes.value}}</div>
33
</div>

templates/repo/issue/milestone_issues.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
{{end}}
2323
</div>
2424
{{if .Milestone.RenderedContent}}
25-
<div class="markup content tw-mb-4">
25+
<div class="render-content markup tw-mb-4">
2626
{{.Milestone.RenderedContent}}
2727
</div>
2828
{{end}}

templates/repo/issue/milestones.tmpl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,7 @@
8181
{{end}}
8282
</div>
8383
{{if .Content}}
84-
<div class="markup content">
85-
{{.RenderedContent}}
86-
</div>
84+
<div class="render-content markup">{{.RenderedContent}}</div>
8785
{{end}}
8886
</li>
8987
{{end}}

templates/repo/latest_commit.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
{{$commitLink:= printf "%s/commit/%s" .RepoLink (PathEscape .LatestCommit.ID.String)}}
2424
<span class="grey commit-summary" title="{{.LatestCommit.Summary}}"><span class="message-wrapper">{{ctx.RenderUtils.RenderCommitMessageLinkSubject .LatestCommit.Message $commitLink ($.Repository.ComposeMetas ctx)}}</span>
2525
{{if IsMultilineCommitMessage .LatestCommit.Message}}
26-
<button class="ui button js-toggle-commit-body ellipsis-button" aria-expanded="false">...</button>
26+
<button class="ui button ellipsis-button" aria-expanded="false" data-global-click="onRepoEllipsisButtonClick">...</button>
2727
<pre class="commit-body tw-hidden">{{ctx.RenderUtils.RenderCommitBody .LatestCommit.Message ($.Repository.ComposeMetas ctx)}}</pre>
2828
{{end}}
2929
</span>

templates/repo/release/list.tmpl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
{{$compareTarget = $release.Sha1}}
2222
{{end}}
2323
{{template "repo/branch_dropdown" dict
24+
"ContainerClasses" "release-branch-tag-selector"
2425
"Repository" $.Repository
2526
"ShowTabTags" true
2627
"DropdownFixedText" (ctx.Locale.Tr "repo.release.compare")
@@ -64,7 +65,7 @@
6465
| <span class="ahead"><a href="{{$.RepoLink}}/compare/{{$release.TagName | PathEscapeSegments}}...{{$release.TargetBehind | PathEscapeSegments}}">{{ctx.Locale.Tr "repo.release.ahead.commits" $release.NumCommitsBehind}}</a> {{ctx.Locale.Tr "repo.release.ahead.target" $release.TargetBehind}}</span>
6566
{{end}}
6667
</p>
67-
<div class="markup desc">
68+
<div class="render-content markup">
6869
{{$release.RenderedNote}}
6970
</div>
7071
<div class="divider"></div>

templates/repo/settings/lfs_file.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
</h4>
1414
<div class="ui bottom attached table unstackable segment">
1515
{{template "repo/unicode_escape_prompt" dict "EscapeStatus" .EscapeStatus "root" $}}
16-
<div class="file-view{{if .IsMarkup}} markup {{.MarkupType}}{{else if .IsPlainText}} plain-text{{else if .IsTextFile}} code-view{{end}}">
16+
<div class="file-view {{if .IsPlainText}}plain-text{{else if .IsTextFile}}code-view{{end}}">
1717
{{if .IsFileTooLarge}}
1818
{{template "shared/filetoolarge" dict "RawFileLink" .RawFileLink}}
1919
{{else if not .FileSize}}
@@ -31,7 +31,7 @@
3131
<strong>{{ctx.Locale.Tr "repo.audio_not_supported_in_browser"}}</strong>
3232
</audio>
3333
{{else if .IsPDFFile}}
34-
<div class="pdf-content is-loading" data-src="{{$.RawFileLink}}" data-fallback-button-text="{{ctx.Locale.Tr "diff.view_file"}}"></div>
34+
<div class="pdf-content is-loading" data-global-init="initPdfViewer" data-src="{{$.RawFileLink}}" data-fallback-button-text="{{ctx.Locale.Tr "diff.view_file"}}"></div>
3535
{{else}}
3636
<a href="{{$.RawFileLink}}" rel="nofollow" class="tw-p-4">{{ctx.Locale.Tr "repo.file_view_raw"}}</a>
3737
{{end}}

templates/repo/view_file.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
{{end}}
5656
</div>
5757
<a download class="btn-octicon" data-tooltip-content="{{ctx.Locale.Tr "repo.download_file"}}" href="{{$.RawFileLink}}">{{svg "octicon-download"}}</a>
58-
<a id="copy-content" class="btn-octicon {{if not .CanCopyContent}} disabled{{end}}"{{if or .IsImageFile (and .HasSourceRenderedToggle (not .IsDisplayingSource))}} data-link="{{$.RawFileLink}}"{{end}} data-tooltip-content="{{if .CanCopyContent}}{{ctx.Locale.Tr "copy_content"}}{{else}}{{ctx.Locale.Tr "copy_type_unsupported"}}{{end}}">{{svg "octicon-copy"}}</a>
58+
<a class="btn-octicon {{if not .CanCopyContent}} disabled{{end}}" data-global-click="onCopyContentButtonClick" {{if or .IsImageFile (and .HasSourceRenderedToggle (not .IsDisplayingSource))}} data-link="{{$.RawFileLink}}"{{end}} data-tooltip-content="{{if .CanCopyContent}}{{ctx.Locale.Tr "copy_content"}}{{else}}{{ctx.Locale.Tr "copy_type_unsupported"}}{{end}}">{{svg "octicon-copy"}}</a>
5959
{{if .EnableFeed}}
6060
<a class="btn-octicon" href="{{$.RepoLink}}/rss/{{$.RefTypeNameSubURL}}/{{PathEscapeSegments .TreePath}}" data-tooltip-content="{{ctx.Locale.Tr "rss_feed"}}">
6161
{{svg "octicon-rss"}}
@@ -108,7 +108,7 @@
108108
<strong>{{ctx.Locale.Tr "repo.audio_not_supported_in_browser"}}</strong>
109109
</audio>
110110
{{else if .IsPDFFile}}
111-
<div class="pdf-content is-loading" data-src="{{$.RawFileLink}}" data-fallback-button-text="{{ctx.Locale.Tr "repo.diff.view_file"}}"></div>
111+
<div class="pdf-content is-loading" data-global-init="initPdfViewer" data-src="{{$.RawFileLink}}" data-fallback-button-text="{{ctx.Locale.Tr "repo.diff.view_file"}}"></div>
112112
{{else}}
113113
<a href="{{$.RawFileLink}}" rel="nofollow" class="tw-p-4">{{ctx.Locale.Tr "repo.file_view_raw"}}</a>
114114
{{end}}

templates/repo/wiki/view.tmpl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,18 +66,18 @@
6666

6767
<div class="wiki-content-parts">
6868
{{if .sidebarTocContent}}
69-
<div class="markup wiki-content-sidebar wiki-content-toc">
69+
<div class="render-content markup wiki-content-sidebar wiki-content-toc">
7070
{{.sidebarTocContent | SafeHTML}}
7171
</div>
7272
{{end}}
7373

74-
<div class="markup wiki-content-main {{if or .sidebarTocContent .sidebarPresent}}with-sidebar{{end}}">
74+
<div class="render-content markup wiki-content-main {{if or .sidebarTocContent .sidebarPresent}}with-sidebar{{end}}">
7575
{{template "repo/unicode_escape_prompt" dict "EscapeStatus" .EscapeStatus "root" $}}
7676
{{.content | SafeHTML}}
7777
</div>
7878

7979
{{if .sidebarPresent}}
80-
<div class="markup wiki-content-sidebar">
80+
<div class="render-content markup wiki-content-sidebar">
8181
{{if and .CanWriteWiki (not .Repository.IsMirror)}}
8282
<a class="tw-float-right muted" href="{{.RepoLink}}/wiki/_Sidebar?action=_edit" aria-label="{{ctx.Locale.Tr "repo.wiki.edit_page_button"}}">{{svg "octicon-pencil"}}</a>
8383
{{end}}
@@ -89,7 +89,7 @@
8989
<div class="tw-clear-both"></div>
9090

9191
{{if .footerPresent}}
92-
<div class="markup wiki-content-footer">
92+
<div class="render-content markup wiki-content-footer">
9393
{{if and .CanWriteWiki (not .Repository.IsMirror)}}
9494
<a class="tw-float-right muted" href="{{.RepoLink}}/wiki/_Footer?action=_edit" aria-label="{{ctx.Locale.Tr "repo.wiki.edit_page_button"}}">{{svg "octicon-pencil"}}</a>
9595
{{end}}

templates/shared/combomarkdowneditor.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
}
8282
</script>
8383
</div>
84-
<div class="ui tab markup" data-tab-panel="markdown-previewer">
84+
<div class="ui tab" data-tab-panel="markdown-previewer">
8585
{{ctx.Locale.Tr "loading"}}
8686
</div>
8787
<div class="markdown-add-table-panel tippy-target">

templates/user/dashboard/feeds.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
<a href="{{.GetCommentLink ctx}}" class="text truncate issue title">{{(.GetIssueTitle ctx) | ctx.RenderUtils.RenderIssueSimpleTitle}}</a>
111111
{{$comment := index .GetIssueInfos 1}}
112112
{{if $comment}}
113-
<div class="markup tw-text-14">{{ctx.RenderUtils.MarkdownToHtml $comment}}</div>
113+
<div class="render-content markup tw-text-14">{{ctx.RenderUtils.MarkdownToHtml $comment}}</div>
114114
{{end}}
115115
{{else if .GetOpType.InActions "merge_pull_request"}}
116116
<div class="flex-item-body text black">{{index .GetIssueInfos 1}}</div>

templates/user/dashboard/milestones.tmpl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
{{end}}
3434
</div>
3535
</div>
36-
<div class="flex-container-main content">
36+
<div class="flex-container-main">
3737
<div class="list-header">
3838
<div class="small-menu-items ui compact tiny menu list-header-toggle">
3939
<a class="item{{if not .IsShowClosed}} active{{end}}" href="?repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort={{$.SortType}}&state=open&q={{$.Keyword}}">
@@ -140,9 +140,7 @@
140140
{{end}}
141141
</div>
142142
{{if .Content}}
143-
<div class="markup content">
144-
{{.RenderedContent}}
145-
</div>
143+
<div class="render-content markup">{{.RenderedContent}}</div>
146144
{{end}}
147145
</li>
148146
{{end}}

templates/user/profile.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
{{else if eq .TabName "followers"}}
2727
{{template "repo/user_cards" .}}
2828
{{else if eq .TabName "overview"}}
29-
<div id="readme_profile" class="markup">{{.ProfileReadmeContent}}</div>
29+
<div id="readme_profile" class="render-content markup">{{.ProfileReadmeContent}}</div>
3030
{{else if eq .TabName "organizations"}}
3131
{{template "repo/user_cards" .}}
3232
{{else}}

web_src/css/editor/fileeditor.css

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,3 @@
7474
padding: 1rem;
7575
text-align: center;
7676
}
77-
78-
.edit-diff {
79-
padding: 0 !important;
80-
}
81-
82-
.edit-diff > div > .ui.table {
83-
border-top: none !important;
84-
border-bottom: none !important;
85-
}

web_src/css/markup/content.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@
535535
user-select: none;
536536
}
537537

538-
.markup-render {
538+
.markup-content-iframe {
539539
display: block;
540540
border: none;
541541
width: 100%;

web_src/css/repo/release-tag.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
display: flex;
4646
align-items: center;
4747
}
48-
#release-list .js-branch-tag-selector {
48+
#release-list .release-branch-tag-selector {
4949
margin-left: auto;
5050
}
5151
#release-list .branch-selector-dropdown .menu { /* open menu to left */

web_src/css/shared/milestone.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
border-top: 1px solid var(--color-secondary);
1313
}
1414

15-
.milestone-card .content {
15+
.milestone-card .render-content {
1616
padding-top: 10px;
1717
}
1818

web_src/js/features/common-button.ts

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {POST} from '../modules/fetch.ts';
2-
import {addDelegatedEventListener, hideElem, queryElems, showElem, toggleElem} from '../utils/dom.ts';
2+
import {addDelegatedEventListener, hideElem, showElem, toggleElem} from '../utils/dom.ts';
33
import {fomanticQuery} from '../modules/fomantic/base.ts';
44
import {camelize} from 'vue';
55

@@ -74,10 +74,9 @@ export function initGlobalDeleteButton(): void {
7474
}
7575
}
7676

77-
function onShowPanelClick(e: MouseEvent) {
77+
function onShowPanelClick(el: HTMLElement, e: MouseEvent) {
7878
// a '.show-panel' element can show a panel, by `data-panel="selector"`
7979
// if it has "toggle" class, it toggles the panel
80-
const el = e.currentTarget as HTMLElement;
8180
e.preventDefault();
8281
const sel = el.getAttribute('data-panel');
8382
if (el.classList.contains('toggle')) {
@@ -87,9 +86,8 @@ function onShowPanelClick(e: MouseEvent) {
8786
}
8887
}
8988

90-
function onHidePanelClick(e: MouseEvent) {
89+
function onHidePanelClick(el: HTMLElement, e: MouseEvent) {
9190
// a `.hide-panel` element can hide a panel, by `data-panel="selector"` or `data-panel-closest="selector"`
92-
const el = e.currentTarget as HTMLElement;
9391
e.preventDefault();
9492
let sel = el.getAttribute('data-panel');
9593
if (sel) {
@@ -104,15 +102,14 @@ function onHidePanelClick(e: MouseEvent) {
104102
throw new Error('no panel to hide'); // should never happen, otherwise there is a bug in code
105103
}
106104

107-
function onShowModalClick(e: MouseEvent) {
105+
function onShowModalClick(el: HTMLElement, e: MouseEvent) {
108106
// A ".show-modal" button will show a modal dialog defined by its "data-modal" attribute.
109107
// Each "data-modal-{target}" attribute will be filled to target element's value or text-content.
110108
// * First, try to query '#target'
111109
// * Then, try to query '[name=target]'
112110
// * Then, try to query '.target'
113111
// * Then, try to query 'target' as HTML tag
114112
// If there is a ".{attr}" part like "data-modal-form.action", then the form's "action" attribute will be set.
115-
const el = e.currentTarget as HTMLElement;
116113
e.preventDefault();
117114
const modalSelector = el.getAttribute('data-modal');
118115
const elModal = document.querySelector(modalSelector);
@@ -160,7 +157,15 @@ export function initGlobalButtons(): void {
160157
// There are a few cancel buttons in non-modal forms, and there are some dynamically created forms (eg: the "Edit Issue Content")
161158
addDelegatedEventListener(document, 'click', 'form button.ui.cancel.button', (_ /* el */, e) => e.preventDefault());
162159

163-
queryElems(document, '.show-panel', (el) => el.addEventListener('click', onShowPanelClick));
164-
queryElems(document, '.hide-panel', (el) => el.addEventListener('click', onHidePanelClick));
165-
queryElems(document, '.show-modal', (el) => el.addEventListener('click', onShowModalClick));
160+
// Ideally these "button" events should be handled by registerGlobalEventFunc
161+
// Refactoring would involve too many changes, so at the moment, just use the global event listener.
162+
addDelegatedEventListener(document, 'click', '.show-panel, .hide-panel, .show-modal', (el, e: MouseEvent) => {
163+
if (el.classList.contains('show-panel')) {
164+
onShowPanelClick(el, e);
165+
} else if (el.classList.contains('hide-panel')) {
166+
onHidePanelClick(el, e);
167+
} else if (el.classList.contains('show-modal')) {
168+
onShowModalClick(el, e);
169+
}
170+
});
166171
}

0 commit comments

Comments
 (0)