File tree 6 files changed +46
-28
lines changed
6 files changed +46
-28
lines changed Original file line number Diff line number Diff line change 4
4
{{end}}
5
5
6
6
<nav id="navbar" aria-label="{{ctx.Locale.Tr "aria.navbar"}}">
7
- <div class="navbar-left ui secondary menu ">
7
+ <div class="navbar-left">
8
8
<!-- the logo -->
9
9
<a class="item" id="navbar-logo" href="{{AppSubUrl}}/" aria-label="{{if .IsSigned}}{{ctx.Locale.Tr "dashboard"}}{{else}}{{ctx.Locale.Tr "home"}}{{end}}">
10
10
<img width="30" height="30" src="{{AssetUrlPrefix}}/img/logo.svg" alt="{{ctx.Locale.Tr "logo"}}" aria-hidden="true">
61
61
</div>
62
62
63
63
<!-- the full dropdown menus -->
64
- <div class="navbar-right ui secondary menu ">
64
+ <div class="navbar-right">
65
65
{{if and .IsSigned .MustChangePassword}}
66
66
<div class="ui dropdown jump item" data-tooltip-content="{{ctx.Locale.Tr "user_profile_and_more"}}">
67
67
<span class="text tw-flex tw-items-center">
104
104
<span class="not-mobile">{{svg "octicon-triangle-down"}}</span>
105
105
<span class="only-mobile">{{ctx.Locale.Tr "create_new"}}</span>
106
106
</span>
107
- <div class="menu left ">
107
+ <div class="menu">
108
108
<a class="item" href="{{AppSubUrl}}/repo/create">
109
109
{{svg "octicon-plus"}} {{ctx.Locale.Tr "new_repo"}}
110
110
</a>
Original file line number Diff line number Diff line change 1
1
<h4 class="ui top attached header">
2
2
{{ctx.Locale.Tr "repo.issues.label_count" .NumLabels}}
3
3
<div class="ui right">
4
- <div class="ui secondary menu">
5
- <!-- Sort -->
6
- <div class="item ui jump dropdown tw-py-2">
7
- <span class="text">
8
- {{ctx.Locale.Tr "repo.issues.filter_sort"}}
9
- </span>
10
- {{svg "octicon-triangle-down" 14 "dropdown icon"}}
11
- <div class="menu">
12
- <a class="{{if or (eq .SortType "alphabetically") (not .SortType)}}active {{end}}item" href="?sort=alphabetically&state={{$.State}}">{{ctx.Locale.Tr "repo.issues.label.filter_sort.alphabetically"}}</a>
13
- <a class="{{if eq .SortType "reversealphabetically"}}active {{end}}item" href="?sort=reversealphabetically&state={{$.State}}">{{ctx.Locale.Tr "repo.issues.label.filter_sort.reverse_alphabetically"}}</a>
14
- <a class="{{if eq .SortType "leastissues"}}active {{end}}item" href="?sort=leastissues&state={{$.State}}">{{ctx.Locale.Tr "repo.milestones.filter_sort.least_issues"}}</a>
15
- <a class="{{if eq .SortType "mostissues"}}active {{end}}item" href="?sort=mostissues&state={{$.State}}">{{ctx.Locale.Tr "repo.milestones.filter_sort.most_issues"}}</a>
16
- </div>
4
+ <!-- Sort -->
5
+ <div class="item ui jump dropdown tw-py-2">
6
+ <span class="text">
7
+ {{ctx.Locale.Tr "repo.issues.filter_sort"}}
8
+ </span>
9
+ {{svg "octicon-triangle-down" 14 "dropdown icon"}}
10
+ <div class="menu">
11
+ <a class="{{if or (eq .SortType "alphabetically") (not .SortType)}}active {{end}}item" href="?sort=alphabetically&state={{$.State}}">{{ctx.Locale.Tr "repo.issues.label.filter_sort.alphabetically"}}</a>
12
+ <a class="{{if eq .SortType "reversealphabetically"}}active {{end}}item" href="?sort=reversealphabetically&state={{$.State}}">{{ctx.Locale.Tr "repo.issues.label.filter_sort.reverse_alphabetically"}}</a>
13
+ <a class="{{if eq .SortType "leastissues"}}active {{end}}item" href="?sort=leastissues&state={{$.State}}">{{ctx.Locale.Tr "repo.milestones.filter_sort.least_issues"}}</a>
14
+ <a class="{{if eq .SortType "mostissues"}}active {{end}}item" href="?sort=mostissues&state={{$.State}}">{{ctx.Locale.Tr "repo.milestones.filter_sort.most_issues"}}</a>
17
15
</div>
18
16
</div>
19
17
</div> <!-- filter menu -->
Original file line number Diff line number Diff line change @@ -134,12 +134,6 @@ h4.ui.header .sub.header {
134
134
font-weight : var (--font-weight-normal );
135
135
}
136
136
137
- /* open dropdown menus to the left in right-attached headers */
138
- .ui .attached .header > .ui .right .ui .dropdown .menu {
139
- right : 0 ;
140
- left : auto;
141
- }
142
-
143
137
/* if a .top.attached.header is followed by a .segment, add some margin */
144
138
.ui .segments + .ui .top .attached .header ,
145
139
.ui .attached .segment + .ui .top .attached .header {
Original file line number Diff line number Diff line change 19
19
margin : 0 ;
20
20
display : flex;
21
21
align-items : center;
22
+ gap : 5px ;
22
23
}
23
24
24
25
# navbar-logo {
25
26
margin : 0 ;
26
27
}
27
28
29
+ .navbar-left > .item ,
30
+ .navbar-right > .item {
31
+ color : var (--color-nav-text );
32
+ position : relative;
33
+ text-decoration : none;
34
+ line-height : var (--line-height-default );
35
+ flex : 0 0 auto;
36
+ font-weight : var (--font-weight-normal );
37
+ align-items : center;
38
+ padding : .78571429em .92857143em ;
39
+ border-radius : .28571429rem ;
40
+ }
41
+
28
42
# navbar .item {
29
43
min-height : 36px ;
30
44
min-width : 36px ;
33
47
display : flex;
34
48
}
35
49
36
- # navbar > .menu > .item {
37
- color : var (--color-nav-text );
38
- }
39
-
40
50
# navbar .dropdown .item {
41
51
justify-content : stretch;
42
52
}
70
80
}
71
81
# navbar .navbar-mobile-right {
72
82
display : flex;
73
- margin-left : auto !important ;
83
+ margin : 0 0 0 auto !important ;
74
84
width : auto !important ;
75
85
}
76
86
# navbar .navbar-mobile-right > .item {
Original file line number Diff line number Diff line change @@ -202,7 +202,7 @@ export default {
202
202
>
203
203
<svg-icon name =" octicon-git-commit" />
204
204
</button >
205
- <div class =" menu left transition " id =" diff-commit-selector-menu" :class =" {visible: menuVisible}" v-show =" menuVisible" v-cloak :aria-expanded =" menuVisible ? 'true': 'false'" >
205
+ <div class =" left menu " id =" diff-commit-selector-menu" :class =" {visible: menuVisible}" v-show =" menuVisible" v-cloak :aria-expanded =" menuVisible ? 'true': 'false'" >
206
206
<div class =" loading-indicator is-loading" v-if =" isLoading" />
207
207
<div v-if =" !isLoading" class =" vertical item" id =" diff-commit-list-show-all" role =" menuitem" @keydown.enter =" showAllChanges()" @click =" showAllChanges()" >
208
208
<div class =" gt-ellipsis" >
Original file line number Diff line number Diff line change @@ -94,6 +94,22 @@ function delegateOne($dropdown) {
94
94
updateSelectionLabel ( $label [ 0 ] ) ;
95
95
return $label ;
96
96
} ) ;
97
+
98
+ const oldSet = dropdownCall ( 'internal' , 'set' ) ;
99
+ const oldSetDirection = oldSet . direction ;
100
+ oldSet . direction = function ( $menu ) {
101
+ oldSetDirection . call ( this , $menu ) ;
102
+ const classNames = dropdownCall ( 'setting' , 'className' ) ;
103
+ $menu = $menu || $dropdown . find ( '> .menu' ) ;
104
+ const elMenu = $menu [ 0 ] ;
105
+ // detect whether the menu is outside the viewport, and adjust the position
106
+ // there is a bug in fomantic's builtin `direction` function, in some cases (when the menu width is only a little larger) it wrongly opens the menu at right and triggers the scrollbar.
107
+ elMenu . classList . add ( classNames . loading ) ;
108
+ if ( elMenu . getBoundingClientRect ( ) . right > document . documentElement . clientWidth ) {
109
+ elMenu . classList . add ( classNames . leftward ) ;
110
+ }
111
+ elMenu . classList . remove ( classNames . loading ) ;
112
+ } ;
97
113
}
98
114
99
115
// for static dropdown elements (generated by server-side template), prepare them with necessary aria attributes
You can’t perform that action at this time.
0 commit comments