File tree 2 files changed +30
-0
lines changed
2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change 27
27
</ui>
28
28
</div>
29
29
<div class="df je ac fw mt-3">
30
+ <div class="ui buttons mr-2">
31
+ <button class="ui icon tiny basic button previous-conversation">
32
+ {{svg "octicon-arrow-up"}} {{$.i18n.Tr "repo.issues.previous"}}
33
+ </button>
34
+ <button class="ui icon tiny basic button next-conversation">
35
+ {{svg "octicon-arrow-down"}} {{$.i18n.Tr "repo.issues.next"}}
36
+ </button>
37
+ </div>
30
38
{{if and $.CanMarkConversation $isNotPending}}
31
39
<button class="ui icon tiny basic button resolve-conversation" data-origin="diff" data-action="{{if not $resolved}}Resolve{{else}}UnResolve{{end}}" data-comment-id="{{(index .comments 0).ID}}" data-update-url="{{$.RepoLink}}/issues/resolve_conversation">
32
40
{{if $resolved}}
Original file line number Diff line number Diff line change @@ -942,6 +942,28 @@ async function initRepository() {
942
942
action : 'hide'
943
943
} ) ;
944
944
945
+ // Previous/Next code review conversation
946
+ $ ( document ) . on ( 'click' , '.previous-conversation' , ( e ) => {
947
+ const $conversation = $ ( e . currentTarget ) . closest ( '.comment-code-cloud' ) ;
948
+ const $conversations = $ ( '.comment-code-cloud:not(.hide)' ) ;
949
+ const index = $conversations . index ( $conversation ) ;
950
+ if ( index !== 0 ) {
951
+ const $previousConversation = $conversations . eq ( index - 1 ) ;
952
+ const anchor = $previousConversation . find ( '.comment' ) . first ( ) . attr ( 'id' ) ;
953
+ window . location . href = `#${ anchor } ` ;
954
+ }
955
+ } ) ;
956
+ $ ( document ) . on ( 'click' , '.next-conversation' , ( e ) => {
957
+ const $conversation = $ ( e . currentTarget ) . closest ( '.comment-code-cloud' ) ;
958
+ const $conversations = $ ( '.comment-code-cloud:not(.hide)' ) ;
959
+ const index = $conversations . index ( $conversation ) ;
960
+ if ( index !== $conversations . length - 1 ) {
961
+ const $nextConversation = $conversations . eq ( index + 1 ) ;
962
+ const anchor = $nextConversation . find ( '.comment' ) . first ( ) . attr ( 'id' ) ;
963
+ window . location . href = `#${ anchor } ` ;
964
+ }
965
+ } ) ;
966
+
945
967
// Quote reply
946
968
$ ( document ) . on ( 'click' , '.quote-reply' , function ( event ) {
947
969
$ ( this ) . closest ( '.dropdown' ) . find ( '.menu' ) . toggle ( 'visible' ) ;
You can’t perform that action at this time.
0 commit comments