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) {
3232
3333 const saveAndRefresh = async ( e ) => {
3434 e . preventDefault ( ) ;
35- form . classList . remove ( 'ignore-dirty' ) ;
3635 renderContent . classList . add ( 'is-loading' ) ;
3736 showElem ( renderContent ) ;
3837 hideElem ( editContentZone ) ;
@@ -52,6 +51,7 @@ async function tryOnEditContent(e) {
5251 showErrorToast ( data . errorMessage ) ;
5352 return ;
5453 }
54+ form . classList . remove ( 'ignore-dirty' ) ; // the form is no longer dirty
5555 reinitializeAreYouSure ( form ) ;
5656 editContentZone . setAttribute ( 'data-content-version' , data . contentVersion ) ;
5757 if ( ! data . content ) {
@@ -101,6 +101,7 @@ async function tryOnEditContent(e) {
101101 cancelButton . addEventListener ( 'click' , cancelAndReset ) ;
102102 form . addEventListener ( 'submit' , saveAndRefresh ) ;
103103 }
104+ form . classList . remove ( 'ignore-dirty' ) ;
104105
105106 // FIXME: ideally here should reload content and attachment list from backend for existing editor, to avoid losing data
106107 if ( ! comboMarkdownEditor . value ( ) ) {
You can’t perform that action at this time.
0 commit comments