Fix apply() to work with an empty string.

Change-Id: Ib7f7c9d9a0d99b3768cea4f7c77f8477c3421bae
This commit is contained in:
Amir E. Aharoni
2012-08-20 15:49:17 +03:00
parent d40e51c4f0
commit 6c3378990e

View File

@@ -70,8 +70,12 @@
apply : function(fontFamily, $element) {
$element = $element || this.$element;
var fontStack = this.options.fontStack.slice(0);
// Loading an empty string is pointless.
// Putting an empty string into a font-family list doesn't work with jQuery.css().
if ( fontFamily ) {
this.load(fontFamily);
fontStack.unshift(fontFamily);
}
$element.css('font-family', fontStack.join() );
$element.find('textarea, input').css('font-family', fontStack.join());
},