From 9576538e21e961f6caa89bc7ffb6bf6f41d033bc Mon Sep 17 00:00:00 2001 From: "Amir E. Aharoni" Date: Thu, 11 Oct 2012 12:21:33 +0200 Subject: [PATCH] Update from GitHub Change-Id: I3af46eea6dd81f09710157db1f3a239c623cef6b --- lib/jquery.webfonts.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/lib/jquery.webfonts.js b/lib/jquery.webfonts.js index b057678b..d3607288 100644 --- a/lib/jquery.webfonts.js +++ b/lib/jquery.webfonts.js @@ -122,8 +122,7 @@ */ parse: function() { var that = this; - that.$element.find( '*[lang], [style], [class]' ).not( that.options.exclude ).each( - function( i, element ) { + that.$element.find( '*[lang], [style], [class]' ).each( function( i, element ) { var fontFamilyStyle, fontFamily, $element = $( element ); fontFamilyStyle = $element.css( 'fontFamily' ); @@ -155,17 +154,19 @@ * @return Array font names array */ list: function( language ) { - var fontName = null, fontNames = []; + var fontName, + fontNames = []; if ( language ) { - fontNames = this.repository.languages[language]; + fontNames = this.repository.languages[language] || []; } else { - for (fontName in this.repository.fonts) { + for ( fontName in this.repository.fonts ) { if ( this.repository.fonts.hasOwnProperty( fontName ) ) { fontNames.push( fontName ); } } } + return fontNames; }, @@ -175,8 +176,10 @@ * @return Array language codes */ languages: function() { - var language = null, languages = []; - for (language in this.repository.languages) { + var language, + languages = []; + + for ( language in this.repository.languages ) { if ( this.repository.languages.hasOwnProperty( language ) ) { languages.push( language ); }