From c7e454558972afaeeb19b02e7bcef8a46b6ffaf6 Mon Sep 17 00:00:00 2001 From: Derk-Jan Hartman Date: Wed, 14 Nov 2018 16:56:43 +0100 Subject: [PATCH] Toolbar: ignore modifications on readonly textarea CodeMirror forces WikiEditor to load. While CodeMirror handles readonly textareas, the WikiEditor toolbar doesn't. CodeMirror and syntaxhighlighting is pretty useful in readonly actually, so I'm making WikiEditor a tad more resistent against readonly mode. Bug: T188817 Change-Id: I927a780e1aea86a19750387f530bad84b1ff5ef4 --- modules/jquery.wikiEditor.toolbar.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/jquery.wikiEditor.toolbar.js b/modules/jquery.wikiEditor.toolbar.js index baa2a616..d7919f84 100644 --- a/modules/jquery.wikiEditor.toolbar.js +++ b/modules/jquery.wikiEditor.toolbar.js @@ -245,6 +245,9 @@ switch ( action.type ) { case 'replace': case 'encapsulate': + if ( context.$textarea.prop( 'readonly' ) ) { + break; + } parts = { pre: $.wikiEditor.autoMsg( action.options, 'pre' ), peri: $.wikiEditor.autoMsg( action.options, 'peri' ),