fix readonly state and TextSelection (v 3.1.2)

Bug: T95149
Bug: T95150
Change-Id: Ia8660d5c2a6dca6a2a37bc60e36620f48aad3260
This commit is contained in:
Pavel Astakhov 2015-04-06 17:33:39 +06:00
parent c800aab7e7
commit ba5a12a679
2 changed files with 4 additions and 3 deletions

View file

@ -15,7 +15,7 @@ if ( !defined( 'MEDIAWIKI' ) ) {
die( 'This file is an extension to MediaWiki and thus not a valid entry point.' );
}
const EXT_CODEMIRROR_VERSION = '3.1.1';
const EXT_CODEMIRROR_VERSION = '3.1.2';
// Register this extension on Special:Version
$wgExtensionCredits['parserhook'][] = array(

View file

@ -7,8 +7,8 @@
api = new mw.Api(),
// function for a textselection function for CodeMirror
cmTextSelection = function ( command, options ) {
if ( !codeMirror ) {
return origTextSelection( command, options );
if ( !codeMirror || codeMirror.getTextArea() !== this[0] ) {
return origTextSelection.call( this, command, options );
}
var fn, retval;
@ -295,6 +295,7 @@
mwextModes: mw.config.get( 'extCodeMirrorExtModes' ),
styleActiveLine: true,
lineWrapping: true,
readOnly: textbox1[0].readOnly,
// select mediawiki as text input mode
mode: 'text/mediawiki'
} );