File tree Expand file tree Collapse file tree 6 files changed +46
-28
lines changed Expand file tree Collapse file tree 6 files changed +46
-28
lines changed Original file line number Diff line number Diff line change 44{{end}}
55
66<nav id="navbar" aria-label="{{ctx.Locale.Tr "aria.navbar"}}">
7- <div class="navbar-left ui secondary menu ">
7+ <div class="navbar-left">
88 <!-- the logo -->
99 <a class="item" id="navbar-logo" href="{{AppSubUrl}}/" aria-label="{{if .IsSigned}}{{ctx.Locale.Tr "dashboard"}}{{else}}{{ctx.Locale.Tr "home"}}{{end}}">
1010 <img width="30" height="30" src="{{AssetUrlPrefix}}/img/logo.svg" alt="{{ctx.Locale.Tr "logo"}}" aria-hidden="true">
6161 </div>
6262
6363 <!-- the full dropdown menus -->
64- <div class="navbar-right ui secondary menu ">
64+ <div class="navbar-right">
6565 {{if and .IsSigned .MustChangePassword}}
6666 <div class="ui dropdown jump item" data-tooltip-content="{{ctx.Locale.Tr "user_profile_and_more"}}">
6767 <span class="text tw-flex tw-items-center">
104104 <span class="not-mobile">{{svg "octicon-triangle-down"}}</span>
105105 <span class="only-mobile">{{ctx.Locale.Tr "create_new"}}</span>
106106 </span>
107- <div class="menu left ">
107+ <div class="menu">
108108 <a class="item" href="{{AppSubUrl}}/repo/create">
109109 {{svg "octicon-plus"}} {{ctx.Locale.Tr "new_repo"}}
110110 </a>
Original file line number Diff line number Diff line change 11<h4 class="ui top attached header">
22 {{ctx.Locale.Tr "repo.issues.label_count" .NumLabels}}
33 <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>
1715 </div>
1816 </div>
1917 </div> <!-- filter menu -->
Original file line number Diff line number Diff line change @@ -134,12 +134,6 @@ h4.ui.header .sub.header {
134134 font-weight : var (--font-weight-normal );
135135}
136136
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-
143137/* if a .top.attached.header is followed by a .segment, add some margin */
144138.ui .segments + .ui .top .attached .header ,
145139.ui .attached .segment + .ui .top .attached .header {
Original file line number Diff line number Diff line change 1919 margin : 0 ;
2020 display : flex;
2121 align-items : center;
22+ gap : 5px ;
2223}
2324
2425# navbar-logo {
2526 margin : 0 ;
2627}
2728
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+
2842# navbar .item {
2943 min-height : 36px ;
3044 min-width : 36px ;
3347 display : flex;
3448}
3549
36- # navbar > .menu > .item {
37- color : var (--color-nav-text );
38- }
39-
4050# navbar .dropdown .item {
4151 justify-content : stretch;
4252}
7080 }
7181 # navbar .navbar-mobile-right {
7282 display : flex;
73- margin-left : auto !important ;
83+ margin : 0 0 0 auto !important ;
7484 width : auto !important ;
7585 }
7686 # navbar .navbar-mobile-right > .item {
Original file line number Diff line number Diff line change @@ -202,7 +202,7 @@ export default {
202202 >
203203 <svg-icon name =" octicon-git-commit" />
204204 </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'" >
206206 <div class =" loading-indicator is-loading" v-if =" isLoading" />
207207 <div v-if =" !isLoading" class =" vertical item" id =" diff-commit-list-show-all" role =" menuitem" @keydown.enter =" showAllChanges()" @click =" showAllChanges()" >
208208 <div class =" gt-ellipsis" >
Original file line number Diff line number Diff line change @@ -94,6 +94,22 @@ function delegateOne($dropdown) {
9494 updateSelectionLabel ( $label [ 0 ] ) ;
9595 return $label ;
9696 } ) ;
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+ } ;
97113}
98114
99115// 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