1
- /* exported deleteDependencyModal, cancelCodeComment, onOAuthLoginClick */
2
-
3
1
import './publicpath.js' ;
4
2
5
3
import Vue from 'vue' ;
@@ -1156,6 +1154,32 @@ async function initRepository() {
1156
1154
return false ;
1157
1155
} ) ;
1158
1156
1157
+ // Delete Issue dependency
1158
+ $ ( document ) . on ( 'click' , '.delete-dependency-button' , ( e ) => {
1159
+ const { id, type} = e . currentTarget . dataset ;
1160
+
1161
+ $ ( '.remove-dependency' ) . modal ( {
1162
+ closable : false ,
1163
+ duration : 200 ,
1164
+ onApprove : ( ) => {
1165
+ $ ( '#removeDependencyID' ) . val ( id ) ;
1166
+ $ ( '#dependencyType' ) . val ( type ) ;
1167
+ $ ( '#removeDependencyForm' ) . trigger ( 'submit' ) ;
1168
+ }
1169
+ } ) . modal ( 'show' ) ;
1170
+ } ) ;
1171
+
1172
+ // Cancel inline code comment
1173
+ $ ( document ) . on ( 'click' , '.cancel-code-comment' , ( e ) => {
1174
+ const form = $ ( e . currentTarget ) . closest ( 'form' ) ;
1175
+ if ( form . length > 0 && form . hasClass ( 'comment-form' ) ) {
1176
+ form . addClass ( 'hide' ) ;
1177
+ form . parent ( ) . find ( 'button.comment-form-reply' ) . show ( ) ;
1178
+ } else {
1179
+ form . closest ( '.comment-code-cloud' ) . remove ( ) ;
1180
+ }
1181
+ } ) ;
1182
+
1159
1183
// Change status
1160
1184
const $statusButton = $ ( '#status-button' ) ;
1161
1185
$ ( '#comment-form textarea' ) . on ( 'keyup' , function ( ) {
@@ -1193,6 +1217,7 @@ async function initRepository() {
1193
1217
$mergeButton . parent ( ) . show ( ) ;
1194
1218
$ ( '.instruct-toggle' ) . show ( ) ;
1195
1219
} ) ;
1220
+
1196
1221
initReactionSelector ( ) ;
1197
1222
}
1198
1223
@@ -3812,19 +3837,6 @@ function initIssueDue() {
3812
3837
} ) ;
3813
3838
}
3814
3839
3815
- window . deleteDependencyModal = function ( id , type ) {
3816
- $ ( '.remove-dependency' )
3817
- . modal ( {
3818
- closable : false ,
3819
- duration : 200 ,
3820
- onApprove ( ) {
3821
- $ ( '#removeDependencyID' ) . val ( id ) ;
3822
- $ ( '#dependencyType' ) . val ( type ) ;
3823
- $ ( '#removeDependencyForm' ) . trigger ( 'submit' ) ;
3824
- }
3825
- } ) . modal ( 'show' ) ;
3826
- } ;
3827
-
3828
3840
function initIssueList ( ) {
3829
3841
const repolink = $ ( '#repolink' ) . val ( ) ;
3830
3842
const repoId = $ ( '#repoId' ) . val ( ) ;
@@ -3911,17 +3923,7 @@ $(document).on('submit', '.conversation-holder form', async (e) => {
3911
3923
initClipboard ( ) ;
3912
3924
} ) ;
3913
3925
3914
- window . cancelCodeComment = function ( btn ) {
3915
- const form = $ ( btn ) . closest ( 'form' ) ;
3916
- if ( form . length > 0 && form . hasClass ( 'comment-form' ) ) {
3917
- form . addClass ( 'hide' ) ;
3918
- form . parent ( ) . find ( 'button.comment-form-reply' ) . show ( ) ;
3919
- } else {
3920
- form . closest ( '.comment-code-cloud' ) . remove ( ) ;
3921
- }
3922
- } ;
3923
-
3924
- window . onOAuthLoginClick = function ( ) {
3926
+ $ ( document ) . on ( 'click' , '.oauth-login-image' , ( ) => {
3925
3927
const oauthLoader = $ ( '#oauth2-login-loader' ) ;
3926
3928
const oauthNav = $ ( '#oauth2-login-navigator' ) ;
3927
3929
@@ -3934,4 +3936,4 @@ window.onOAuthLoginClick = function () {
3934
3936
oauthLoader . addClass ( 'disabled' ) ;
3935
3937
oauthNav . show ( ) ;
3936
3938
} , 5000 ) ;
3937
- } ;
3939
+ } ) ;
0 commit comments