Skip to content

Commit d306ab2

Browse files
authored
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)
1 parent 7b5b739 commit d306ab2

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

templates/code/searchform.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<div class="ui dropdown selection tooltip{{if .CodeIndexerUnavailable}} disabled{{end}}" data-content="{{.locale.Tr "explore.search.type.tooltip"}}">
55
<input name="t" type="hidden" value="{{.queryType}}"{{if .CodeIndexerUnavailable}} disabled{{end}}>{{svg "octicon-triangle-down" 14 "dropdown icon"}}
66
<div class="text">{{.locale.Tr (printf "explore.search.%s" (or .queryType "fuzzy"))}}</div>
7-
<div class="menu transition hidden" tabindex="-1" style="display: block !important;">
7+
<div class="menu">
88
<div class="item tooltip" data-value="" data-content="{{.locale.Tr "explore.search.fuzzy.tooltip"}}">{{.locale.Tr "explore.search.fuzzy"}}</div>
99
<div class="item tooltip" data-value="match" data-content="{{.locale.Tr "explore.search.match.tooltip"}}">{{.locale.Tr "explore.search.match"}}</div>
1010
</div>

templates/repo/issue/view_content/sidebar.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@
639639

640640
<div class="default text"> </div>
641641

642-
<div class="menu transition hidden" tabindex="-1" style="display: block !important;">
642+
<div class="menu">
643643
{{range .LockReasons}}
644644
<div class="item" data-value="{{.}}">{{.}}</div>
645645
{{end}}

templates/repo/search.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<div class="ui dropdown selection tooltip{{if .CodeIndexerUnavailable}} disabled{{end}}" data-content="{{.locale.Tr "repo.search.type.tooltip"}}">
1010
<input name="t" type="hidden"{{if .CodeIndexerUnavailable}} disabled{{end}} value="{{.queryType}}">{{svg "octicon-triangle-down" 14 "dropdown icon"}}
1111
<div class="text">{{.locale.Tr (printf "repo.search.%s" (or .queryType "fuzzy"))}}</div>
12-
<div class="menu transition hidden" tabindex="-1" style="display: block !important;">
12+
<div class="menu">
1313
<div class="item tooltip" data-value="" data-content="{{.locale.Tr "repo.search.fuzzy.tooltip"}}">{{.locale.Tr "repo.search.fuzzy"}}</div>
1414
<div class="item tooltip" data-value="match" data-content="{{.locale.Tr "repo.search.match.tooltip"}}">{{.locale.Tr "repo.search.match"}}</div>
1515
</div>

templates/repo/settings/branches.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
{{end}}
3030
</select>{{svg "octicon-triangle-down" 14 "dropdown icon"}}
3131
<div class="default text">{{.Repository.DefaultBranch}}</div>
32-
<div class="menu transition hidden" tabindex="-1" style="display: block !important;">
32+
<div class="menu">
3333
{{range .Branches}}
3434
<div class="item" data-value="{{.}}">{{.}}</div>
3535
{{end}}

templates/repo/settings/options.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@
538538
{{.locale.Tr "repo.pulls.squash_merge_pull_request"}}
539539
{{end}}
540540
</div>
541-
<div class="menu transition hidden" tabindex="-1" style="display: block !important;">
541+
<div class="menu">
542542
<div class="item" data-value="merge">{{.locale.Tr "repo.pulls.merge_pull_request"}}</div>
543543
<div class="item" data-value="rebase">{{.locale.Tr "repo.pulls.rebase_merge_pull_request"}}</div>
544544
<div class="item" data-value="rebase-merge">{{.locale.Tr "repo.pulls.rebase_merge_commit_pull_request"}}</div>

0 commit comments

Comments
 (0)