@@ -24,7 +24,6 @@ async function tryOnEditContent(e) {
2424 e . preventDefault ( ) ;
2525 showElem ( renderContent ) ;
2626 hideElem ( editContentZone ) ;
27- window . removeEventListener ( 'beforeunload' , showUserHintOnNavigate ) ;
2827 comboMarkdownEditor . dropzoneReloadFiles ( ) ;
2928 } ;
3029
@@ -33,7 +32,6 @@ async function tryOnEditContent(e) {
3332 renderContent . classList . add ( 'is-loading' ) ;
3433 showElem ( renderContent ) ;
3534 hideElem ( editContentZone ) ;
36- window . removeEventListener ( 'beforeunload' , showUserHintOnNavigate ) ;
3735 try {
3836 const params = new URLSearchParams ( {
3937 content : comboMarkdownEditor . value ( ) ,
@@ -84,7 +82,6 @@ async function tryOnEditContent(e) {
8482 // Show write/preview tab and copy raw content as needed
8583 showElem ( editContentZone ) ;
8684 hideElem ( renderContent ) ;
87- window . addEventListener ( 'beforeunload' , showUserHintOnNavigate ) ;
8885
8986 comboMarkdownEditor = getComboMarkdownEditor ( editContentZone . querySelector ( '.combo-markdown-editor' ) ) ;
9087 if ( ! comboMarkdownEditor ) {
@@ -151,11 +148,6 @@ async function tryOnQuoteReply(e) {
151148 editor . moveCursorToEnd ( ) ;
152149}
153150
154- // Show a warning message when the user tries to navigate, even though he is currently editing
155- function showUserHintOnNavigate ( e : BeforeUnloadEvent ) {
156- e . preventDefault ( ) ;
157- }
158-
159151export function initRepoIssueCommentEdit ( ) {
160152 document . addEventListener ( 'click' , ( e ) => {
161153 tryOnEditContent ( e ) ; // Edit issue or comment content
0 commit comments