Ensure CM surface can't be edited in VE mode

CM surface is just for presentation, it shouldn't
be possible to focus or select anything in the surface,
so in addition to it being beneath the VE surface,
disable it through the CM API and disable pointer-events
with CSS.

Bug: T170170
Change-Id: Ief49c293f514e22bc6db5eebb3a11c1bc695432d
This commit is contained in:
Ed Sanders 2017-07-10 17:40:51 +01:00 committed by Bartosz Dziewoński
parent c6ccd44f95
commit 91397eb556
2 changed files with 2 additions and 0 deletions

View file

@ -11,6 +11,7 @@
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
pointer-events: none;
padding: 0 1.14286em; /* 1/0.875 */
@media screen and ( min-width: 982px ) {

View file

@ -46,6 +46,7 @@ ve.ui.CodeMirrorAction.prototype.toggle = function ( enable ) {
surface.mirror = CodeMirror( surfaceView.$element[ 0 ], {
value: surface.getDom(),
mwConfig: mw.config.get( 'extCodeMirrorConfig' ),
readOnly: 'nocursor',
lineWrapping: true,
tabSize: 1,
scrollbarStyle: 'null',