File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3131 </div>
3232 </div>
3333 </div>
34- <div id= " branch-list" class= " scrolling menu reference-list-menu" >
34+ <div id= " branch-list" class= " scrolling menu reference-list-menu {{if not .Issue}}new-issue{{end}} " >
3535 {{if .Issue.Ref }}
3636 <div class= " item text small" data-id= " " data-id-selector= " #ref_selector" ><strong><a href= " #" >{{$ .i18n.Tr " repo.clear_ref" }}</a></strong></div>
3737 {{end }}
3838 {{range .Branches }}
3939 <div class= " item" data-id= " refs/heads/{{.}}" data-name= " {{.}}" data-id-selector= " #ref_selector" >{{. }}</div>
4040 {{end }}
4141 </div>
42- <div id= " tag-list" class= " scrolling menu reference-list-menu" style= " display: none" >
42+ <div id= " tag-list" class= " scrolling menu reference-list-menu {{if not .Issue}}new-issue{{end}} " style= " display: none" >
4343 {{if .Issue.Ref }}
4444 <div class= " item text small" data-id= " " data-id-selector= " #ref_selector" ><strong><a href= " #" >{{.i18n.Tr " repo.clear_ref" }}</a></strong></div>
4545 {{end }}
Original file line number Diff line number Diff line change @@ -112,10 +112,15 @@ function initEditForm() {
112112function initBranchSelector ( ) {
113113 const $selectBranch = $ ( '.ui.select-branch' ) ;
114114 const $branchMenu = $selectBranch . find ( '.reference-list-menu' ) ;
115+ const $isNewIssue = $branchMenu . hasClass ( 'new-issue' ) ;
115116 $branchMenu . find ( '.item:not(.no-select)' ) . click ( function ( ) {
116117 const selectedValue = $ ( this ) . data ( 'id' ) ;
117118 const editMode = $ ( '#editing_mode' ) . val ( ) ;
118119 $ ( $ ( this ) . data ( 'id-selector' ) ) . val ( selectedValue ) ;
120+ if ( $isNewIssue ) {
121+ $selectBranch . find ( '.ui .branch-name' ) . text ( $ ( this ) . data ( 'name' ) ) ;
122+ return ;
123+ }
119124
120125 if ( editMode === 'true' ) {
121126 const form = $ ( '#update_issueref_form' ) ;
You can’t perform that action at this time.
0 commit comments