@@ -24,7 +24,6 @@ async function tryOnEditContent(e) {
24
24
e . preventDefault ( ) ;
25
25
showElem ( renderContent ) ;
26
26
hideElem ( editContentZone ) ;
27
- window . removeEventListener ( 'beforeunload' , showUserHintOnNavigate ) ;
28
27
comboMarkdownEditor . dropzoneReloadFiles ( ) ;
29
28
} ;
30
29
@@ -33,7 +32,6 @@ async function tryOnEditContent(e) {
33
32
renderContent . classList . add ( 'is-loading' ) ;
34
33
showElem ( renderContent ) ;
35
34
hideElem ( editContentZone ) ;
36
- window . removeEventListener ( 'beforeunload' , showUserHintOnNavigate ) ;
37
35
try {
38
36
const params = new URLSearchParams ( {
39
37
content : comboMarkdownEditor . value ( ) ,
@@ -84,7 +82,6 @@ async function tryOnEditContent(e) {
84
82
// Show write/preview tab and copy raw content as needed
85
83
showElem ( editContentZone ) ;
86
84
hideElem ( renderContent ) ;
87
- window . addEventListener ( 'beforeunload' , showUserHintOnNavigate ) ;
88
85
89
86
comboMarkdownEditor = getComboMarkdownEditor ( editContentZone . querySelector ( '.combo-markdown-editor' ) ) ;
90
87
if ( ! comboMarkdownEditor ) {
@@ -151,11 +148,6 @@ async function tryOnQuoteReply(e) {
151
148
editor . moveCursorToEnd ( ) ;
152
149
}
153
150
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
-
159
151
export function initRepoIssueCommentEdit ( ) {
160
152
document . addEventListener ( 'click' , ( e ) => {
161
153
tryOnEditContent ( e ) ; // Edit issue or comment content
0 commit comments