Santhosh has uploaded a new change for review.

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


Change subject: Update jquery.ime from upstream
......................................................................

Update jquery.ime from upstream

Change-Id: I9dd87f44c0465801ac225a1bdc6268e85f89911e
---
M lib/jquery.webfonts.js
1 file changed, 14 insertions(+), 2 deletions(-)


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

diff --git a/lib/jquery.webfonts.js b/lib/jquery.webfonts.js
index 72b41b6..aec719e 100644
--- a/lib/jquery.webfonts.js
+++ b/lib/jquery.webfonts.js
@@ -103,10 +103,13 @@
                        // jQuery.css().
                        if ( fontFamily ) {
                                this.load( fontFamily );
-                               fontStack.unshift( fontFamily );
+                               // Avoid duplicates
+                               if ( $.inArray( fontFamily, fontStack ) < 0 ) {
+                                       fontStack.unshift( fontFamily );
+                               }
                        }
 
-                       if ( !fontFamily || fontFamily === 
this.originalFontFamily ) {
+                       if ( !fontFamily ) {
                                // We are resetting the font to original font.
                                fontStack = [];
                                // This will cause removing inline fontFamily 
style.
@@ -204,7 +207,16 @@
 
                                // Load and apply fonts for other language 
tagged elements (batched)
                                if ( element.lang && element.lang !== 
webfonts.language ) {
+                                       // Child elements language differs from 
parent.
                                        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;
+                                       }
                                        // We do not have fonts for all 
languages
                                        if ( fontFamily !== null ) {
                                                append( fontQueue, fontFamily );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9dd87f44c0465801ac225a1bdc6268e85f89911e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UniversalLanguageSelector
Gerrit-Branch: master
Gerrit-Owner: Santhosh <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to