Forgejo/web_src/js/features
Giteabot 22911a1ece
Imrove scroll behavior to hash issuecomment(scroll position, auto expand if file is folded, and on refreshing) (#23513) (#23540)
Backport #23513 by @HesterG

Close #23466
Right now on pull request "files Changed" tab, if a file is viewed, when
the comments' links are visited, the comment will not be shown as the
file is folded after viewed. This PR is to improve the behavior, to make
the comment seen even the related file is folded, like on github.

And right now scroll position will be remembered and hence it won’t
scroll to hashed comment after refreshing, this PR also adjust the
scroll position remembering behavior: When there is hash comment in url,
do not remember the scroll position.

Before:


https://user-images.githubusercontent.com/17645053/225512079-6cf79581-9346-44cf-95d6-06919642e6a8.mov


After:


https://user-images.githubusercontent.com/17645053/225523753-3f6728f2-977b-4ed0-a65c-63dcef2ace80.mov


Update - long comment's behavior after using `scrollTop ` (Comment div
scroll to the position which is 30px below the diff header, or 30px
below top on conversation tab):


https://user-images.githubusercontent.com/17645053/225614460-0602c1a6-229c-41f4-84d2-334e78251486.mov

Co-authored-by: Hester Gong <hestergong@gmail.com>
2023-03-17 22:59:18 -04:00
..
admin Fix some more hidden problems (#23074) (#23075) 2023-02-22 15:26:48 +00:00
comp Scoped labels: set aria-disabled on muted Exclusive option for a11y (#23306) (#23311) 2023-03-05 23:05:11 +08:00
aria.js Fix incorrect display for comment context menu (#23343) (#23344) 2023-03-08 23:18:53 +08:00
aria.md Improve frontend guidelines (#23007) 2023-02-21 14:13:37 +08:00
captcha.js Add new captcha: cloudflare turnstile (#22369) 2023-02-05 15:29:03 +08:00
citation.js Fix switched citation format (#23250) (#23253) 2023-03-02 14:05:10 -06:00
clipboard.js Use link in UI which returned a relative url but not html_url which contains an absolute url (#21986) 2023-02-06 12:09:18 -06:00
codeeditor.js Quick fixes monaco-editor error: "vs.editor.nullLanguage" (#21734) 2022-11-09 18:02:19 +08:00
colorpicker.js JS refactors (#22227) 2022-12-24 00:03:11 +08:00
common-global.js Improve PR Review Box UI (#22986) 2023-02-21 21:36:53 +08:00
common-issue.js Refactor hiding-methods, remove jQuery show/hide, remove .hide class, remove inline style=display:none (#22950) 2023-02-19 12:06:14 +08:00
common-organization.js Refactor hiding-methods, remove jQuery show/hide, remove .hide class, remove inline style=display:none (#22950) 2023-02-19 12:06:14 +08:00
contextpopup.js Change interactiveBorder to fix popup preview (#23169) (#23314) 2023-03-06 16:45:43 +08:00
copycontent.js JS refactors (#22227) 2022-12-24 00:03:11 +08:00
dropzone.js JS refactors (#22227) 2022-12-24 00:03:11 +08:00
emoji.js JS refactors (#22227) 2022-12-24 00:03:11 +08:00
eventsource.sharedworker.js Fix the JS error "EventSource is not defined" caused by some non-standard browsers (#20584) 2022-08-03 22:58:27 +03:00
file-fold.js JS refactors (#22227) 2022-12-24 00:03:11 +08:00
formatting.js JS refactors (#22227) 2022-12-24 00:03:11 +08:00
heatmap.js JS refactors (#22227) 2022-12-24 00:03:11 +08:00
imagediff.js Fix various ImageDiff/SVG bugs (#23312) (#23358) 2023-03-07 15:38:13 +02:00
install.js Fix various bugs for "install" page (#23194) (#23286) 2023-03-05 11:59:58 +01:00
notification.js Move helpers to be prefixed with gt- (#22879) 2023-02-13 17:59:59 +00:00
org-team.js Refactor hiding-methods, remove jQuery show/hide, remove .hide class, remove inline style=display:none (#22950) 2023-02-19 12:06:14 +08:00
pull-view-file.js Replace unstyled meter with progress (#19968) 2022-06-15 12:28:24 +08:00
repo-branch.js Add apply-patch, basic revert and cherry-pick functionality (#17902) 2022-02-09 20:28:55 +00:00
repo-code.js Fix links for the menus in the view file page (#22795) 2023-02-08 00:08:44 +08:00
repo-code.test.js Ignore line anchor links with leading zeroes (#21728) 2022-11-11 18:22:36 +08:00
repo-commit.js Fix hidden commit status on multiple checks (#22889) 2023-02-20 16:43:04 +08:00
repo-common.js Refactor hiding-methods, remove jQuery show/hide, remove .hide class, remove inline style=display:none (#22950) 2023-02-19 12:06:14 +08:00
repo-diff-filetree.js JS refactors (#22227) 2022-12-24 00:03:11 +08:00
repo-diff.js Refactor hiding-methods, remove jQuery show/hide, remove .hide class, remove inline style=display:none (#22950) 2023-02-19 12:06:14 +08:00
repo-editor.js Refactor hiding-methods, remove jQuery show/hide, remove .hide class, remove inline style=display:none (#22950) 2023-02-19 12:06:14 +08:00
repo-findfile.js Refactor hiding-methods, remove jQuery show/hide, remove .hide class, remove inline style=display:none (#22950) 2023-02-19 12:06:14 +08:00
repo-findfile.test.js Escape path for the file list (#22741) 2023-02-04 10:30:55 +00:00
repo-graph.js Refactor hiding-methods, remove jQuery show/hide, remove .hide class, remove inline style=display:none (#22950) 2023-02-19 12:06:14 +08:00
repo-home.js Refactor hiding-methods, remove jQuery show/hide, remove .hide class, remove inline style=display:none (#22950) 2023-02-19 12:06:14 +08:00
repo-issue-content.js Refactor hiding-methods, remove jQuery show/hide, remove .hide class, remove inline style=display:none (#22950) 2023-02-19 12:06:14 +08:00
repo-issue-pr-form.js JS refactors (#22227) 2022-12-24 00:03:11 +08:00
repo-issue.js Imrove scroll behavior to hash issuecomment(scroll position, auto expand if file is folded, and on refreshing) (#23513) (#23540) 2023-03-17 22:59:18 -04:00
repo-legacy.js Scoped labels: don't require holding alt key to remove (#23303) (#23331) 2023-03-06 12:59:53 -06:00
repo-migrate.js Refactor hiding-methods, remove jQuery show/hide, remove .hide class, remove inline style=display:none (#22950) 2023-02-19 12:06:14 +08:00
repo-migration.js Refactor hiding-methods, remove jQuery show/hide, remove .hide class, remove inline style=display:none (#22950) 2023-02-19 12:06:14 +08:00
repo-projects.js Scoped labels (#22585) 2023-02-18 21:17:39 +02:00
repo-release.js Refactor hiding-methods, remove jQuery show/hide, remove .hide class, remove inline style=display:none (#22950) 2023-02-19 12:06:14 +08:00
repo-settings.js Remove customized (unmaintained) dropdown, improve aria a11y for dropdown (#19861) 2022-06-03 17:38:26 -04:00
repo-template.js Refactor hiding-methods, remove jQuery show/hide, remove .hide class, remove inline style=display:none (#22950) 2023-02-19 12:06:14 +08:00
repo-unicode-escape.js Refactor hiding-methods, remove jQuery show/hide, remove .hide class, remove inline style=display:none (#22950) 2023-02-19 12:06:14 +08:00
repo-wiki.js Enable spellcheck for EasyMDE, use contenteditable mode (#19776) 2022-06-29 01:52:58 +08:00
serviceworker.js JS refactors (#22227) 2022-12-24 00:03:11 +08:00
sshkey-helper.js Use explicit jQuery import, remove unused eslint globals (#18435) 2022-01-28 21:00:11 +00:00
stopwatch.js Move helpers to be prefixed with gt- (#22879) 2023-02-13 17:59:59 +00:00
tablesort.js JS refactors (#22227) 2022-12-24 00:03:11 +08:00
tribute.js JS refactors (#22227) 2022-12-24 00:03:11 +08:00
user-auth-webauthn.js Refactor hiding-methods, remove jQuery show/hide, remove .hide class, remove inline style=display:none (#22950) 2023-02-19 12:06:14 +08:00
user-auth.js Refactor hiding-methods, remove jQuery show/hide, remove .hide class, remove inline style=display:none (#22950) 2023-02-19 12:06:14 +08:00
user-settings.js Refactor hiding-methods, remove jQuery show/hide, remove .hide class, remove inline style=display:none (#22950) 2023-02-19 12:06:14 +08:00