mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CodeMirror
synced 2024-11-23 13:56:44 +00:00
Merge "CodeMirror: load colorblind theme when preference is set"
This commit is contained in:
commit
ec28e18016
2
resources/dist/main.js
vendored
2
resources/dist/main.js
vendored
File diff suppressed because one or more lines are too long
2
resources/dist/main.js.map.json
vendored
2
resources/dist/main.js.map.json
vendored
File diff suppressed because one or more lines are too long
|
@ -162,6 +162,15 @@ export default class CodeMirror {
|
|||
parent: this.$textarea.parent()[ 0 ]
|
||||
} );
|
||||
|
||||
// Add colorblind mode if preference is set.
|
||||
// This currently is only to be used for the MediaWiki markup language.
|
||||
if (
|
||||
mw.user.options.get( 'usecodemirror-colorblind' ) &&
|
||||
mw.config.get( 'wgPageContentModel' ) === 'wikitext'
|
||||
) {
|
||||
this.view.dom.classList.add( 'cm-mw-colorblind-colors' );
|
||||
}
|
||||
|
||||
// Hide native textarea and sync CodeMirror contents upon submission.
|
||||
this.$textarea.hide();
|
||||
if ( this.$textarea[ 0 ].form ) {
|
||||
|
|
Loading…
Reference in a new issue