File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 104
104
data-modal-default-project-board-header="{{$.locale.Tr "repo.projects.column.set_default"}}"
105
105
data-modal-default-project-board-content="{{$.locale.Tr "repo.projects.column.set_default_desc"}}"
106
106
data-modal-default-project-board-submit="{{$.locale.Tr "repo.projects.column.set_default"}}"
107
+ data-type="set_default"
107
108
data-url="{{$.Link}}/{{.ID}}/default">
108
109
{{svg "octicon-pin"}}
109
110
{{$.locale.Tr "repo.projects.column.set_default"}}
114
115
data-modal-default-project-board-header="{{$.locale.Tr "repo.projects.column.unset_default"}}"
115
116
data-modal-default-project-board-content="{{$.locale.Tr "repo.projects.column.unset_default_desc"}}"
116
117
data-modal-default-project-board-submit="{{$.locale.Tr "repo.projects.column.unset_default"}}"
118
+ data-type="unset_default"
117
119
data-url="{{$.Link}}/{{.ID}}/unsetdefault">
118
120
{{svg "octicon-pin"}}
119
121
{{$.locale.Tr "repo.projects.column.unset_default"}}
Original file line number Diff line number Diff line change @@ -129,8 +129,14 @@ export function initRepoProject() {
129
129
$ ( '.default-project-board-modal' ) . each ( function ( ) {
130
130
const boardColumn = $ ( this ) . closest ( '.board-column' ) ;
131
131
const showButton = $ ( boardColumn ) . find ( '.default-project-board-show' ) ;
132
+ const commitButton = $ ( this ) . find ( '.default-project-board-button' ) ;
132
133
133
- $ ( this ) . find ( '.default-project-board-button' ) . on ( 'click' , function ( e ) {
134
+ if ( $ ( showButton ) . data ( 'type' ) === 'unset_default' ) {
135
+ $ ( commitButton ) . removeClass ( 'primary' ) ;
136
+ $ ( commitButton ) . addClass ( 'red' ) ;
137
+ }
138
+
139
+ $ ( commitButton ) . on ( 'click' , function ( e ) {
134
140
e . preventDefault ( ) ;
135
141
136
142
$ . ajax ( {
You can’t perform that action at this time.
0 commit comments