File tree 5 files changed +14
-18
lines changed
templates/repo/issue/view_content
5 files changed +14
-18
lines changed Original file line number Diff line number Diff line change 1
1
{{if .ctxData.IsSigned}}
2
- <div class="item action ui pointing select-reaction dropdown top right" data-action-url="{{.ActionURL}}">
2
+ <div class="item action ui dropdown jump pointing top right select-reaction " data-action-url="{{.ActionURL}}">
3
3
<a class="add-reaction">
4
4
{{svg "octicon-smiley"}}
5
5
</a>
Original file line number Diff line number Diff line change 1
1
{{if .ctxData.IsSigned}}
2
- <div class="item action ui pointing custom dropdown top right context-dropdown">
2
+ <div class="item action ui dropdown jump pointing top right context-dropdown">
3
3
<a class="context-menu">
4
4
{{svg "octicon-kebab-horizontal"}}
5
5
</a>
Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ function attachOneDropdownAria($dropdown) {
77
77
'aria-expanded' : 'false' ,
78
78
} ) ;
79
79
80
- const isMenuVisible = ( ) => $menu . hasClass ( 'visible' ) || $menu . is ( '.animating.in ') ;
80
+ const isMenuVisible = ( ) => $menu . hasClass ( 'visible' ) && ! $menu . hasClass ( 'out ') ; // when hiding, it has class: ".animating.out"
81
81
82
82
// update aria attributes according to current active/selected item
83
83
const refreshAria = ( ) => {
Original file line number Diff line number Diff line change @@ -89,9 +89,12 @@ export function initGlobalCommon() {
89
89
90
90
// Semantic UI modules.
91
91
const $uiDropdowns = $ ( '.ui.dropdown' ) ;
92
- $uiDropdowns . filter ( ':not(.custom)' ) . dropdown ( {
93
- fullTextSearch : 'exact'
94
- } ) ;
92
+
93
+ // do not init "custom" dropdowns, "custom" dropdowns are managed by their own code.
94
+ $uiDropdowns . filter ( ':not(.custom)' ) . dropdown ( { fullTextSearch : 'exact' } ) ;
95
+
96
+ // "jump" means this dropdown is mainly used for "menu" purpose, clicking an item will jump to somewhere else or trigger an action/function.
97
+ // when a dropdown is used for non-refresh actions with tippy, it must have this "jump" class to hide the tippy when dropdown is closed.
95
98
$uiDropdowns . filter ( '.jump' ) . dropdown ( {
96
99
action : 'hide' ,
97
100
onShow ( ) {
@@ -102,16 +105,12 @@ export function initGlobalCommon() {
102
105
onHide ( ) {
103
106
this . _tippy ?. enable ( ) ;
104
107
} ,
105
- fullTextSearch : 'exact'
106
- } ) ;
107
- $uiDropdowns . filter ( '.slide.up' ) . dropdown ( {
108
- transition : 'slide up' ,
109
- fullTextSearch : 'exact'
110
- } ) ;
111
- $uiDropdowns . filter ( '.upward' ) . dropdown ( {
112
- direction : 'upward' ,
113
- fullTextSearch : 'exact'
114
108
} ) ;
109
+
110
+ // special animations/popup-directions
111
+ $uiDropdowns . filter ( '.slide.up' ) . dropdown ( { transition : 'slide up' } ) ;
112
+ $uiDropdowns . filter ( '.upward' ) . dropdown ( { direction : 'upward' } ) ;
113
+
115
114
attachDropdownAria ( $uiDropdowns ) ;
116
115
117
116
attachCheckboxAria ( $ ( '.ui.checkbox' ) ) ;
Original file line number Diff line number Diff line change @@ -601,9 +601,6 @@ export function initRepository() {
601
601
}
602
602
603
603
function initRepoIssueCommentEdit ( ) {
604
- // Issue/PR Context Menus
605
- $ ( '.comment-header-right .context-dropdown' ) . dropdown ( { action : 'hide' } ) ;
606
-
607
604
// Edit issue or comment content
608
605
$ ( document ) . on ( 'click' , '.edit-content' , onEditContent ) ;
609
606
You can’t perform that action at this time.
0 commit comments