0
Fork 0
mirror of https://github.com/fastmail/Squire.git synced 2025-01-03 05:00:13 -05:00

Added checks to prevent overwriting of detected font info.

This commit is contained in:
Gert K. Sønderby 2015-08-31 10:11:06 +02:00
parent f6b79eb82b
commit b6af31e4b5
3 changed files with 5 additions and 5 deletions

View file

@ -2851,10 +2851,10 @@ proto.getFontInfo = function ( range ) {
element = element.parentNode;
}
while ( !( fontInfo.family && fontInfo.size ) && element && element.nodeName !== 'BODY' ) {
if ( element.style.fontFamily ) {
if ( element.style.fontFamily && !fontInfo.family ) {
fontInfo.family = element.style.fontFamily;
}
if ( element.style.fontSize ) {
if ( element.style.fontSize && !fontInfo.size ) {
fontInfo.size = element.style.fontSize;
}
element = element.parentNode;

File diff suppressed because one or more lines are too long

View file

@ -726,10 +726,10 @@ proto.getFontInfo = function ( range ) {
element = element.parentNode;
}
while ( !( fontInfo.family && fontInfo.size ) && element && element.nodeName !== 'BODY' ) {
if ( element.style.fontFamily ) {
if ( element.style.fontFamily && !fontInfo.family ) {
fontInfo.family = element.style.fontFamily;
}
if ( element.style.fontSize ) {
if ( element.style.fontSize && !fontInfo.size ) {
fontInfo.size = element.style.fontSize;
}
element = element.parentNode;