Fomafix has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/395692 )
Change subject: Early exit when the gadget wikEd is enabled
......................................................................
Early exit when the gadget wikEd is enabled
This change prevents that a semi-functional button is shown in the
toolbar.
Bug: T182157
Change-Id: Idfee99a8216633a337e6daac286575c2cd19cd03
---
M resources/ext.CodeMirror.js
1 file changed, 7 insertions(+), 4 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CodeMirror
refs/changes/92/395692/1
diff --git a/resources/ext.CodeMirror.js b/resources/ext.CodeMirror.js
index 03a84f0..1218194 100644
--- a/resources/ext.CodeMirror.js
+++ b/resources/ext.CodeMirror.js
@@ -2,7 +2,12 @@
var origTextSelection, useCodeMirror, codeMirror, api,
originHooksTextarea,
wikiEditorToolbarEnabled, enableContentEditable = true;
- if ( mw.config.get( 'wgCodeEditorCurrentLanguage' ) ) { // If the
CodeEditor is used then just exit;
+ // Early exit when there is another editor that replaces the textarea.
+ // FIXME: Would be good to replace the wikEd check with something more
generic.
+ if (
+ mw.config.get( 'wgCodeEditorCurrentLanguage' ) || // CodeEditor
+ mw.user.options.get( 'gadget-wikEd' ) > 0 // wikEd
+ ) {
return;
}
@@ -300,9 +305,7 @@
selectionEnd = $textbox1.prop( 'selectionEnd' ),
scrollTop = $textbox1.scrollTop();
- // If CodeMirror is already loaded or wikEd gadget is
enabled, abort. See T178348.
- // FIXME: Would be good to replace the wikEd check with
something more generic.
- if ( codeMirror || mw.user.options.get( 'gadget-wikEd'
) > 0 ) {
+ if ( codeMirror ) { // Already loaded
return;
}
--
To view, visit https://gerrit.wikimedia.org/r/395692
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Idfee99a8216633a337e6daac286575c2cd19cd03
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CodeMirror
Gerrit-Branch: master
Gerrit-Owner: Fomafix <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits