File tree 4 files changed +20
-8
lines changed
4 files changed +20
-8
lines changed Original file line number Diff line number Diff line change 2
2
<div class="issue-title" id="issue-title-wrapper">
3
3
{{if and (or .HasIssuesOrPullsWritePermission .IsIssuePoster) (not .Repository.IsArchived)}}
4
4
<div class="edit-button">
5
- <div id="edit-title" class="ui basic secondary not-in-edit button ">{{.locale.Tr "repo.issues.edit"}}</div >
5
+ <button id="edit-title" class="ui basic button secondary not-in-edit">{{.locale.Tr "repo.issues.edit"}}</button >
6
6
</div>
7
7
{{end}}
8
8
<h1>
9
9
<span id="issue-title">{{RenderIssueTitle $.Context .Issue.Title $.RepoLink $.Repository.ComposeMetas | RenderCodeBlock}}</span>
10
10
<span class="index">#{{.Issue.Index}}</span>
11
- <div id="edit-title-input" class="ui input" style="display: none">
11
+ <div id="edit-title-input" class="ui input ml-4 " style="display: none">
12
12
<input value="{{.Issue.Title}}" maxlength="255" autocomplete="off">
13
13
</div>
14
14
</h1>
15
15
{{if and (or .HasIssuesOrPullsWritePermission .IsIssuePoster) (not .Repository.IsArchived)}}
16
16
<div class="edit-buttons">
17
- <div id="cancel-edit-title" class="ui basic secondary in-edit button " style="display: none">{{.locale.Tr "repo.issues.cancel"}}</div >
18
- <div id="save-edit-title" class="ui primary in-edit button " style="display: none" data-update-url="{{$.RepoLink}}/issues/{{.Issue.Index}}/title" {{if .Issue.IsPull}}data-target-update-url="{{$.RepoLink}}/pull/{{.Issue.Index}}/target_branch"{{end}}>{{.locale.Tr "repo.issues.save"}}</div >
17
+ <button id="cancel-edit-title" class="ui basic button secondary in-edit" style="display: none">{{.locale.Tr "repo.issues.cancel"}}</button >
18
+ <button id="save-edit-title" class="ui primary button in-edit" style="display: none" data-update-url="{{$.RepoLink}}/issues/{{.Issue.Index}}/title" {{if .Issue.IsPull}}data-target-update-url="{{$.RepoLink}}/pull/{{.Issue.Index}}/target_branch"{{end}}>{{.locale.Tr "repo.issues.save"}}</button >
19
19
</div>
20
20
{{end}}
21
21
</div>
Original file line number Diff line number Diff line change @@ -60,6 +60,7 @@ export function initGlobalButtonClickOnEnter() {
60
60
$ ( document ) . on ( 'keypress' , '.ui.button' , ( e ) => {
61
61
if ( e . keyCode === 13 || e . keyCode === 32 ) { // enter key or space bar
62
62
$ ( e . target ) . trigger ( 'click' ) ;
63
+ e . preventDefault ( ) ;
63
64
}
64
65
} ) ;
65
66
}
Original file line number Diff line number Diff line change @@ -605,6 +605,7 @@ export function initRepoIssueTitleEdit() {
605
605
const targetBranch = $ ( '#pull-target-branch' ) . data ( 'branch' ) ;
606
606
const $branchTarget = $ ( '#branch_target' ) ;
607
607
if ( targetBranch === $branchTarget . text ( ) ) {
608
+ window . location . reload ( ) ;
608
609
return false ;
609
610
}
610
611
$ . post ( update_url , {
@@ -617,19 +618,22 @@ export function initRepoIssueTitleEdit() {
617
618
} ) ;
618
619
} ;
619
620
620
- const pullrequest_target_update_url = $ ( this ) . data ( ' target-update-url') ;
621
+ const pullrequest_target_update_url = $ ( this ) . attr ( 'data- target-update-url') ;
621
622
if ( $editInput . val ( ) . length === 0 || $editInput . val ( ) === $issueTitle . text ( ) ) {
622
623
$editInput . val ( $issueTitle . text ( ) ) ;
623
624
pullrequest_targetbranch_change ( pullrequest_target_update_url ) ;
624
625
} else {
625
- $ . post ( $ ( this ) . data ( ' update-url') , {
626
+ $ . post ( $ ( this ) . attr ( 'data- update-url') , {
626
627
_csrf : csrfToken ,
627
628
title : $editInput . val ( )
628
629
} , ( data ) => {
629
630
$editInput . val ( data . title ) ;
630
631
$issueTitle . text ( data . title ) ;
631
- pullrequest_targetbranch_change ( pullrequest_target_update_url ) ;
632
- window . location . reload ( ) ;
632
+ if ( pullrequest_target_update_url ) {
633
+ pullrequest_targetbranch_change ( pullrequest_target_update_url ) ; // it will reload the window
634
+ } else {
635
+ window . location . reload ( ) ;
636
+ }
633
637
} ) ;
634
638
}
635
639
return false ;
Original file line number Diff line number Diff line change @@ -2316,6 +2316,13 @@ a.ui.label:hover {
2316
2316
.ui.basic.secondary.buttons .button :active ,
2317
2317
.ui.basic.secondary.button :active {
2318
2318
color : var (--color-secondary-dark-8 ) !important ;
2319
+ border-color : var (--color-secondary-dark-1 ) !important ;
2320
+ }
2321
+
2322
+ .ui.basic.secondary.button :focus ,
2323
+ .ui.basic.secondary.buttons .button :focus {
2324
+ color : var (--color-secondary-dark-8 ) !important ;
2325
+ border-color : var (--color-secondary-dark-3 ) !important ;
2319
2326
}
2320
2327
2321
2328
.ui.tertiary.button {
You can’t perform that action at this time.
0 commit comments