Add change handler for Edit Recovery

When the Edit Recovery loading process is finished, add an Ace
editor change handler so that the Edit Recovery fields are saved
whenever there's a change to the CodeEditor data.

This is similar to the change made for CodeMirror:
I352470752130c7b9b2dfc55a066cecf785d40067

Bug: T344406
Change-Id: I2c7826379108a88be7956d84bbfd3200b5ad542f
This commit is contained in:
Sam Wilson 2023-09-20 16:10:22 +08:00
parent 7c52cac05e
commit f7a7c7afea

View file

@ -400,6 +400,11 @@
mw.hook( 'codeEditor.configure' ).fire( session );
// Add an Ace change handler to pass changes to Edit Recovery.
mw.hook( 'editRecovery.loadEnd' ).add( function ( data ) {
session.on( 'change', data.fieldChangeHandler );
} );
ace.config.loadModule( 'ace/ext/modelist', function ( modelist ) {
if ( !modelist || !modelist.modesByName[ lang ] ) {
lang = 'text';