diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2023-02-14 19:53:54 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-14 19:53:54 +0800 |
commit | d306ab2b8f871fbf505519468bfbaed91deaf7e0 (patch) | |
tree | b0d0195c5c869fbcf24cabc6c30477e653efa72b | |
parent | 7b5b739a2f9d9c84ec216ff629dbf0d1dd8a4322 (diff) | |
download | gitea-d306ab2b8f871fbf505519468bfbaed91deaf7e0.tar.gz gitea-d306ab2b8f871fbf505519468bfbaed91deaf7e0.zip |
Remove Fomantic-UI's `.hidden` CSS class for menu elements (#22895)
* Like #22851
* All other dropdown menu elements do not have such `hidden` class.
* Actually the dropdown menu elements do not need it in HTML, so this PR
removes it.
* There is already `.ui.dropdown .menu { display: none; }`, so when
loading the page, the menu is correctly hidden initially, no need to add
any more CSS classes.
* The Fomantic UI's `.hidden` class should still exist until there is no
its checkbox/dropdown module anymore. The Fomantic UI JS code still
addes `hidden` for `ui checkbox` and addes `transition hidden` for `ui
menu` at the moment.
* This PR also cleans the legacy inline `style`, which is quite hacky
and no need anymore.
All these dropdown menus work well.
I have tested these 5 places:
* The code search from User Profile
* The issue sidebar to lock issue
* The repo search form
* The repo setting page: branch list
* The repo setting page: merge option list
Screenshot:
![image](https://user-images.githubusercontent.com/2114189/218534515-e7dfe291-6765-4e0b-833c-b74f17e30117.png)
-rw-r--r-- | templates/code/searchform.tmpl | 2 | ||||
-rw-r--r-- | templates/repo/issue/view_content/sidebar.tmpl | 2 | ||||
-rw-r--r-- | templates/repo/search.tmpl | 2 | ||||
-rw-r--r-- | templates/repo/settings/branches.tmpl | 2 | ||||
-rw-r--r-- | templates/repo/settings/options.tmpl | 2 |
5 files changed, 5 insertions, 5 deletions
diff --git a/templates/code/searchform.tmpl b/templates/code/searchform.tmpl index 17d1944e13..c4d05cd597 100644 --- a/templates/code/searchform.tmpl +++ b/templates/code/searchform.tmpl @@ -4,7 +4,7 @@ <div class="ui dropdown selection tooltip{{if .CodeIndexerUnavailable}} disabled{{end}}" data-content="{{.locale.Tr "explore.search.type.tooltip"}}"> <input name="t" type="hidden" value="{{.queryType}}"{{if .CodeIndexerUnavailable}} disabled{{end}}>{{svg "octicon-triangle-down" 14 "dropdown icon"}} <div class="text">{{.locale.Tr (printf "explore.search.%s" (or .queryType "fuzzy"))}}</div> - <div class="menu transition hidden" tabindex="-1" style="display: block !important;"> + <div class="menu"> <div class="item tooltip" data-value="" data-content="{{.locale.Tr "explore.search.fuzzy.tooltip"}}">{{.locale.Tr "explore.search.fuzzy"}}</div> <div class="item tooltip" data-value="match" data-content="{{.locale.Tr "explore.search.match.tooltip"}}">{{.locale.Tr "explore.search.match"}}</div> </div> diff --git a/templates/repo/issue/view_content/sidebar.tmpl b/templates/repo/issue/view_content/sidebar.tmpl index 0f256b6be8..8437ab8234 100644 --- a/templates/repo/issue/view_content/sidebar.tmpl +++ b/templates/repo/issue/view_content/sidebar.tmpl @@ -639,7 +639,7 @@ <div class="default text"> </div> - <div class="menu transition hidden" tabindex="-1" style="display: block !important;"> + <div class="menu"> {{range .LockReasons}} <div class="item" data-value="{{.}}">{{.}}</div> {{end}} diff --git a/templates/repo/search.tmpl b/templates/repo/search.tmpl index 4122961eff..21f758e4a9 100644 --- a/templates/repo/search.tmpl +++ b/templates/repo/search.tmpl @@ -9,7 +9,7 @@ <div class="ui dropdown selection tooltip{{if .CodeIndexerUnavailable}} disabled{{end}}" data-content="{{.locale.Tr "repo.search.type.tooltip"}}"> <input name="t" type="hidden"{{if .CodeIndexerUnavailable}} disabled{{end}} value="{{.queryType}}">{{svg "octicon-triangle-down" 14 "dropdown icon"}} <div class="text">{{.locale.Tr (printf "repo.search.%s" (or .queryType "fuzzy"))}}</div> - <div class="menu transition hidden" tabindex="-1" style="display: block !important;"> + <div class="menu"> <div class="item tooltip" data-value="" data-content="{{.locale.Tr "repo.search.fuzzy.tooltip"}}">{{.locale.Tr "repo.search.fuzzy"}}</div> <div class="item tooltip" data-value="match" data-content="{{.locale.Tr "repo.search.match.tooltip"}}">{{.locale.Tr "repo.search.match"}}</div> </div> diff --git a/templates/repo/settings/branches.tmpl b/templates/repo/settings/branches.tmpl index cf3ca0a7d6..6e51fc7bb2 100644 --- a/templates/repo/settings/branches.tmpl +++ b/templates/repo/settings/branches.tmpl @@ -29,7 +29,7 @@ {{end}} </select>{{svg "octicon-triangle-down" 14 "dropdown icon"}} <div class="default text">{{.Repository.DefaultBranch}}</div> - <div class="menu transition hidden" tabindex="-1" style="display: block !important;"> + <div class="menu"> {{range .Branches}} <div class="item" data-value="{{.}}">{{.}}</div> {{end}} diff --git a/templates/repo/settings/options.tmpl b/templates/repo/settings/options.tmpl index 283991b716..030c77b881 100644 --- a/templates/repo/settings/options.tmpl +++ b/templates/repo/settings/options.tmpl @@ -538,7 +538,7 @@ {{.locale.Tr "repo.pulls.squash_merge_pull_request"}} {{end}} </div> - <div class="menu transition hidden" tabindex="-1" style="display: block !important;"> + <div class="menu"> <div class="item" data-value="merge">{{.locale.Tr "repo.pulls.merge_pull_request"}}</div> <div class="item" data-value="rebase">{{.locale.Tr "repo.pulls.rebase_merge_pull_request"}}</div> <div class="item" data-value="rebase-merge">{{.locale.Tr "repo.pulls.rebase_merge_commit_pull_request"}}</div> |