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:
parent
f6b79eb82b
commit
b6af31e4b5
3 changed files with 5 additions and 5 deletions
|
@ -2851,10 +2851,10 @@ proto.getFontInfo = function ( range ) {
|
||||||
element = element.parentNode;
|
element = element.parentNode;
|
||||||
}
|
}
|
||||||
while ( !( fontInfo.family && fontInfo.size ) && element && element.nodeName !== 'BODY' ) {
|
while ( !( fontInfo.family && fontInfo.size ) && element && element.nodeName !== 'BODY' ) {
|
||||||
if ( element.style.fontFamily ) {
|
if ( element.style.fontFamily && !fontInfo.family ) {
|
||||||
fontInfo.family = element.style.fontFamily;
|
fontInfo.family = element.style.fontFamily;
|
||||||
}
|
}
|
||||||
if ( element.style.fontSize ) {
|
if ( element.style.fontSize && !fontInfo.size ) {
|
||||||
fontInfo.size = element.style.fontSize;
|
fontInfo.size = element.style.fontSize;
|
||||||
}
|
}
|
||||||
element = element.parentNode;
|
element = element.parentNode;
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -726,10 +726,10 @@ proto.getFontInfo = function ( range ) {
|
||||||
element = element.parentNode;
|
element = element.parentNode;
|
||||||
}
|
}
|
||||||
while ( !( fontInfo.family && fontInfo.size ) && element && element.nodeName !== 'BODY' ) {
|
while ( !( fontInfo.family && fontInfo.size ) && element && element.nodeName !== 'BODY' ) {
|
||||||
if ( element.style.fontFamily ) {
|
if ( element.style.fontFamily && !fontInfo.family ) {
|
||||||
fontInfo.family = element.style.fontFamily;
|
fontInfo.family = element.style.fontFamily;
|
||||||
}
|
}
|
||||||
if ( element.style.fontSize ) {
|
if ( element.style.fontSize && !fontInfo.size ) {
|
||||||
fontInfo.size = element.style.fontSize;
|
fontInfo.size = element.style.fontSize;
|
||||||
}
|
}
|
||||||
element = element.parentNode;
|
element = element.parentNode;
|
||||||
|
|
Loading…
Reference in a new issue