Santhosh has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/83972


Change subject: WIP monospace fix
......................................................................

WIP monospace fix

Change-Id: I58c9c3fb74774e26e0f680cec0b0f9b2d3b2c11c
---
M lib/jquery.webfonts.js
1 file changed, 11 insertions(+), 7 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UniversalLanguageSelector 
refs/changes/72/83972/1

diff --git a/lib/jquery.webfonts.js b/lib/jquery.webfonts.js
index b4c0b5e..5daa220 100644
--- a/lib/jquery.webfonts.js
+++ b/lib/jquery.webfonts.js
@@ -206,16 +206,20 @@
                                }
 
                                // Load and apply fonts for other language 
tagged elements (batched)
-                               if ( element.lang && element.lang !== 
webfonts.language ) {
+                               if ( element.lang ) {
                                        // Child element's language differs 
from parent.
-                                       fontFamily = webfonts.getFont( 
element.lang );
+                                       // If there is no explicit font for 
this language, it will
+                                       // inherit the webfont for the parent.  
But that is undesirable here
+                                       // since language is different. So 
inherit the original font of the
+                                       // element. Define it explicitly so 
that inheritance is broken.
 
+                                       // If the language has a font, use it.
+                                       // If not, try to retain the elements 
style
+                                       // even if it is not present use 
original font
+                                       // of the element to which this 
extension is applied.
+                                       fontFamily = webfonts.getFont( 
element.lang );
                                        if ( !fontFamily ) {
-                                               // If there is no explicit font 
for this language, it will
-                                               // inherit the webfont for the 
parent.  But that is undesirable here
-                                               // since language is different. 
So inherit the original font of the
-                                               // element. Define it 
explicitly so that inheritance is broken.
-                                               fontFamily = 
webfonts.originalFontFamily;
+                                               fontFamily = ( fontFamilyStyle 
=== 'monospace' ) ? fontFamilyStyle: webfonts.originalFontFamily;
                                        }
                                        // We do not have fonts for all 
languages
                                        if ( fontFamily !== null ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/83972
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I58c9c3fb74774e26e0f680cec0b0f9b2d3b2c11c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UniversalLanguageSelector
Gerrit-Branch: master
Gerrit-Owner: Santhosh <santhosh.thottin...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to