Fix apply() to work with an empty string.
Change-Id: Ib7f7c9d9a0d99b3768cea4f7c77f8477c3421bae
This commit is contained in:
@@ -70,8 +70,12 @@
|
||||
apply : function(fontFamily, $element) {
|
||||
$element = $element || this.$element;
|
||||
var fontStack = this.options.fontStack.slice(0);
|
||||
this.load(fontFamily);
|
||||
fontStack.unshift(fontFamily);
|
||||
// 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());
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user