mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CodeEditor
synced 2024-11-23 14:56:43 +00:00
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:
parent
7c52cac05e
commit
f7a7c7afea
|
@ -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';
|
||||
|
|
Loading…
Reference in a new issue