mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CodeMirror
synced 2024-11-15 10:19:27 +00:00
Merge "Fire a hook when the CodeMirror editor is switched"
This commit is contained in:
commit
79284952de
|
@ -195,6 +195,8 @@
|
|||
if ( mw.config.get( 'wgCodeMirrorAccessibilityColors' ) ) {
|
||||
$codeMirror.addClass( 'cm-mw-accessible-colors' );
|
||||
}
|
||||
|
||||
mw.hook( 'ext.CodeMirror.switch' ).fire( true, $codeMirror );
|
||||
} );
|
||||
}
|
||||
|
||||
|
@ -253,6 +255,8 @@
|
|||
$textbox1.prop( 'selectionStart', selectionStart );
|
||||
$textbox1.prop( 'selectionEnd', selectionEnd );
|
||||
$textbox1.scrollTop( scrollTop );
|
||||
|
||||
mw.hook( 'ext.CodeMirror.switch' ).fire( false, $textbox1 );
|
||||
} else {
|
||||
enableCodeMirror();
|
||||
setCodeEditorPreference( true );
|
||||
|
|
Loading…
Reference in a new issue