File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,6 @@ async function tryOnEditContent(e) {
32
32
33
33
const saveAndRefresh = async ( e ) => {
34
34
e . preventDefault ( ) ;
35
- form . classList . remove ( 'ignore-dirty' ) ;
36
35
renderContent . classList . add ( 'is-loading' ) ;
37
36
showElem ( renderContent ) ;
38
37
hideElem ( editContentZone ) ;
@@ -52,6 +51,7 @@ async function tryOnEditContent(e) {
52
51
showErrorToast ( data . errorMessage ) ;
53
52
return ;
54
53
}
54
+ form . classList . remove ( 'ignore-dirty' ) ; // the form is no longer dirty
55
55
reinitializeAreYouSure ( form ) ;
56
56
editContentZone . setAttribute ( 'data-content-version' , data . contentVersion ) ;
57
57
if ( ! data . content ) {
@@ -101,6 +101,7 @@ async function tryOnEditContent(e) {
101
101
cancelButton . addEventListener ( 'click' , cancelAndReset ) ;
102
102
form . addEventListener ( 'submit' , saveAndRefresh ) ;
103
103
}
104
+ form . classList . remove ( 'ignore-dirty' ) ;
104
105
105
106
// FIXME: ideally here should reload content and attachment list from backend for existing editor, to avoid losing data
106
107
if ( ! comboMarkdownEditor . value ( ) ) {
You can’t perform that action at this time.
0 commit comments