Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork6.3k
Refactor legacy line-number and scroll code#33094
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
c64d476 to6bc2439Compare6bc2439 tocfe33b6CompareUh oh!
There was an error while loading.Please reload this page.
web_src/css/base.css Outdated
| .ui.dropdown .menu> .header { | ||
| font-size:0.8em; | ||
| text-transform: none;/* reset fomantic's "uppercase" */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Sure, we have fixed all "uppercase" headers in history, modern UI doesn't use uppercase.
This is the last one.
wxiaoguangJan 4, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
| // set scrollRestoration to 'manual' when there is a hash in url, so that the scroll position will not be remembered after refreshing | ||
| if(window.history.scrollRestoration!=='manual')window.history.scrollRestoration='manual'; | ||
| // wait for a while because some elements (eg: image, editor, etc.) may change the viewport's height. | ||
| setTimeout(()=>commentDiv.scrollIntoView({block:'start'}),100); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
maybe center better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I have tested, "center" is not good enough. For example, when the comment is quite long.
| } | ||
| }; | ||
| onHashChange(); | ||
| window.addEventListener('hashchange',onHashChange); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
just to inform,history.pushState does not fire hashchange event, so not sure if this listener does something
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
It is the case when user manually change the URL, eg:
/file#L1 =>/file#L1-L3
And that's the old logic, I think it is good to keep it
| if(first){ | ||
| // set scrollRestoration to 'manual' when there is a hash in url, so that the scroll position will not be remembered after refreshing | ||
| if(window.history.scrollRestoration!=='manual')window.history.scrollRestoration='manual'; | ||
| first.scrollIntoView({block:'start'}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
same here. maybe center better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
According to my test, I think "start" is better.
Uh oh!
There was an error while loading.Please reload this page.
5f7018d to31e9debCompare2b064b8 intogo-gitea:mainUh oh!
There was an error while loading.Please reload this page.
* giteaofficial/main: [skip ci] Updated translations via Crowdin Fix dropdown menu header and mobile view (go-gitea#33108) workflow_dispatch use workflow from trigger branch (go-gitea#33098) [skip ci] Updated translations via Crowdin Trivial fixes (go-gitea#33103) Fix empty git repo handling logic (go-gitea#33101) Refactor legacy line-number and scroll code (go-gitea#33094) Use `Project-URL` metadata field to get a PyPI package's homepage URL (go-gitea#33089) Clean up legacy form CSS styles (go-gitea#33081) [skip ci] Updated translations via Crowdin add myself to maintainers (go-gitea#33088) Make Gitea always use its internal config, ignore `/etc/gitconfig` (go-gitea#33076) Fix "stop time tracking button" on navbar (go-gitea#33084) Fix bleve fuzziness search (go-gitea#33078) Try to fix ACME directory problem (go-gitea#33072) Refactor env var related code (go-gitea#33075)


Uh oh!
There was an error while loading.Please reload this page.
Now 7 "import jquery" files left.
Some fixes could be backport to 1.23 (not blocking the release)