KartikMistry has uploaded a new change for review.

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

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

Update jquery.webfonts from upstream

 Upstream: https://github.com/wikimedia/jquery.webfonts
 Changes:
 * Bug 56081: Reset webfonts where we found inline css style upon reset.
   This will fix broken live preview of content font bug.

Change-Id: I60a75611db8cc299b6cc9ba14c5aff6719cb3239
---
M lib/jquery.webfonts.js
1 file changed, 12 insertions(+), 5 deletions(-)


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

diff --git a/lib/jquery.webfonts.js b/lib/jquery.webfonts.js
index e7ce234..24d3d1d 100644
--- a/lib/jquery.webfonts.js
+++ b/lib/jquery.webfonts.js
@@ -118,14 +118,18 @@
                                // This will cause removing inline fontFamily 
style.
                        }
 
-                       // Set the font of this element if it's not excluded
-                       $element.not( this.options.exclude ).css( 
'font-family', fontStack.join() );
+                       // Set the font of this element if it's not excluded.
+                       // Add class webfonts-changed when webfonts are applied.
+                       $element.not( this.options.exclude )
+                               .css( 'font-family', fontStack.join() )
+                               .addClass( 'webfonts-changed' );
 
                        // Set the font of this element's children if they are 
not excluded.
                        // font-family of <input>, <textarea> and <button> must 
be changed explicitly.
-                       $element.find( 'textarea, input, button' )
-                               .not( this.options.exclude )
-                               .css( 'font-family', fontStack.join() );
+                       // Add class webfonts-changed when webfonts are applied.
+                       $element.find( 'textarea, input, button' ).not( 
this.options.exclude )
+                               .css( 'font-family', fontStack.join() )
+                               .addClass( 'webfonts-changed' );
                },
 
                /**
@@ -328,6 +332,9 @@
                 * Reset the font-family style.
                 */
                reset: function() {
+                       this.$element.find( '.webfonts-changed' )
+                               .removeClass( '.webfonts-changed' )
+                               .css( 'font-family', '' );
                        this.apply( this.originalFontFamily );
                },
 

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

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

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

Reply via email to