]> source.dussan.org Git - gitea.git/commit
Rewrite and restyle reaction selector and enable no-sizzle eslint rule (#30453) ...
authorGiteabot <teabot@gitea.io>
Sun, 14 Apr 2024 11:58:48 +0000 (19:58 +0800)
committerGitHub <noreply@github.com>
Sun, 14 Apr 2024 11:58:48 +0000 (11:58 +0000)
commit0352b992218d21af5937c11e52fb303f5792d607
treefc8b0e2d4aaae1b877ea90bd3bfad260b1ee2fd5
parentdd128610115c62c96bd1f9df09aae32603c17c17
Rewrite and restyle reaction selector and enable no-sizzle eslint rule (#30453) (#30473)

Backport #30453 by @silverwind

Enable `no-sizzle` lint rule, there was only one use in
`initCompReactionSelector` which I have rewritten as follows:

- Remove all jQuery except the necessary fomantic dropdown init
- Remove the recursion, instead bind event listeners to common parent
container nodes

Did various tests, works with our without attachments, in diff view and
in diff comments inside comment list.

Additionally the style of reactions now matches between code comments
and issue comments:

<img width="275" alt="Screenshot 2024-04-13 at 14 58 10"
src="https://github.com/go-gitea/gitea/assets/115237/9d08f188-8661-4dd9-bff4-cad6d6d09cab">

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
17 files changed:
.eslintrc.yaml
routers/web/repo/issue.go
services/context/context.go
templates/repo/diff/comments.tmpl
templates/repo/issue/view_content.tmpl
templates/repo/issue/view_content/add_reaction.tmpl
templates/repo/issue/view_content/comments.tmpl
templates/repo/issue/view_content/conversation.tmpl
templates/repo/issue/view_content/reactions.tmpl
web_src/css/base.css
web_src/css/index.css
web_src/css/modules/comment.css
web_src/css/repo.css
web_src/css/repo/reactions.css [new file with mode: 0644]
web_src/js/features/comp/ReactionSelector.js
web_src/js/features/repo-diff.js
web_src/js/features/repo-legacy.js