mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CodeMirror
synced 2024-11-12 08:50:57 +00:00
Disable WebkitTextFillColor in Firefox+OSX
Avoids opaque selection covering text. Bug: T175223 Change-Id: Iede96501d4a03ccd80488b4661c18647eb9118e1
This commit is contained in:
parent
0296e2dcad
commit
80241fb717
|
@ -130,6 +130,7 @@
|
|||
"ext.visualEditor.mwcore",
|
||||
"ext.CodeMirror.lib",
|
||||
"ext.CodeMirror.mode.mediawiki",
|
||||
"jquery.client",
|
||||
"mediawiki.api",
|
||||
"mediawiki.api.options",
|
||||
"user.options"
|
||||
|
|
|
@ -38,7 +38,8 @@ ve.ui.CodeMirrorAction.static.methods = [ 'toggle' ];
|
|||
* @return {boolean} Action was executed
|
||||
*/
|
||||
ve.ui.CodeMirrorAction.prototype.toggle = function ( enable ) {
|
||||
var surface = this.surface,
|
||||
var profile, supportsTransparentText,
|
||||
surface = this.surface,
|
||||
surfaceView = surface.getView(),
|
||||
doc = surface.getModel().getDocument();
|
||||
|
||||
|
@ -63,8 +64,13 @@ ve.ui.CodeMirrorAction.prototype.toggle = function ( enable ) {
|
|||
// so revert any editfont user preference
|
||||
surfaceView.$element.removeClass( 'mw-editfont-sans-serif mw-editfont-serif' ).addClass( 'mw-editfont-monospace' );
|
||||
|
||||
profile = $.client.profile();
|
||||
supportsTransparentText = 'WebkitTextFillColor' in document.body.style &&
|
||||
// Disable on Firefox+OSX (T175223)
|
||||
!( profile.layout === 'gecko' && profile.platform === 'mac' );
|
||||
|
||||
surfaceView.$documentNode.addClass(
|
||||
'WebkitTextFillColor' in document.body.style ?
|
||||
supportsTransparentText ?
|
||||
've-ce-documentNode-codeEditor-webkit-hide' :
|
||||
've-ce-documentNode-codeEditor-hide'
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue