mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CodeMirror
synced 2024-11-27 15:40:00 +00:00
Merge "Disable WebkitTextFillColor in Firefox+OSX"
This commit is contained in:
commit
d25705d804
|
@ -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