mirror of
https://github.com/fastmail/Squire.git
synced 2025-01-18 04:32:28 -05:00
parent
7330324d92
commit
2fccc317ad
3 changed files with 21 additions and 19 deletions
|
@ -2896,7 +2896,7 @@ proto.getFontInfo = function ( range ) {
|
||||||
size: undefined
|
size: undefined
|
||||||
};
|
};
|
||||||
var seenAttributes = 0;
|
var seenAttributes = 0;
|
||||||
var element, style;
|
var element, style, attr;
|
||||||
|
|
||||||
if ( !range && !( range = this.getSelection() ) ) {
|
if ( !range && !( range = this.getSelection() ) ) {
|
||||||
return fontInfo;
|
return fontInfo;
|
||||||
|
@ -2908,20 +2908,21 @@ proto.getFontInfo = function ( range ) {
|
||||||
element = element.parentNode;
|
element = element.parentNode;
|
||||||
}
|
}
|
||||||
while ( seenAttributes < 4 && element && ( style = element.style ) ) {
|
while ( seenAttributes < 4 && element && ( style = element.style ) ) {
|
||||||
if ( !fontInfo.color ) {
|
if ( !fontInfo.color && ( attr = style.color ) ) {
|
||||||
fontInfo.color = style.color;
|
fontInfo.color = attr;
|
||||||
seenAttributes += 1;
|
seenAttributes += 1;
|
||||||
}
|
}
|
||||||
if ( !fontInfo.backgroundColor ) {
|
if ( !fontInfo.backgroundColor &&
|
||||||
fontInfo.backgroundColor = style.backgroundColor;
|
( attr = style.backgroundColor ) ) {
|
||||||
|
fontInfo.backgroundColor = attr;
|
||||||
seenAttributes += 1;
|
seenAttributes += 1;
|
||||||
}
|
}
|
||||||
if ( !fontInfo.family ) {
|
if ( !fontInfo.family && ( attr = style.fontFamily ) ) {
|
||||||
fontInfo.family = style.fontFamily;
|
fontInfo.family = attr;
|
||||||
seenAttributes += 1;
|
seenAttributes += 1;
|
||||||
}
|
}
|
||||||
if ( !fontInfo.size ) {
|
if ( !fontInfo.size && ( attr = style.fontSize ) ) {
|
||||||
fontInfo.size = style.fontSize;
|
fontInfo.size = attr;
|
||||||
seenAttributes += 1;
|
seenAttributes += 1;
|
||||||
}
|
}
|
||||||
element = element.parentNode;
|
element = element.parentNode;
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -768,7 +768,7 @@ proto.getFontInfo = function ( range ) {
|
||||||
size: undefined
|
size: undefined
|
||||||
};
|
};
|
||||||
var seenAttributes = 0;
|
var seenAttributes = 0;
|
||||||
var element, style;
|
var element, style, attr;
|
||||||
|
|
||||||
if ( !range && !( range = this.getSelection() ) ) {
|
if ( !range && !( range = this.getSelection() ) ) {
|
||||||
return fontInfo;
|
return fontInfo;
|
||||||
|
@ -780,20 +780,21 @@ proto.getFontInfo = function ( range ) {
|
||||||
element = element.parentNode;
|
element = element.parentNode;
|
||||||
}
|
}
|
||||||
while ( seenAttributes < 4 && element && ( style = element.style ) ) {
|
while ( seenAttributes < 4 && element && ( style = element.style ) ) {
|
||||||
if ( !fontInfo.color ) {
|
if ( !fontInfo.color && ( attr = style.color ) ) {
|
||||||
fontInfo.color = style.color;
|
fontInfo.color = attr;
|
||||||
seenAttributes += 1;
|
seenAttributes += 1;
|
||||||
}
|
}
|
||||||
if ( !fontInfo.backgroundColor ) {
|
if ( !fontInfo.backgroundColor &&
|
||||||
fontInfo.backgroundColor = style.backgroundColor;
|
( attr = style.backgroundColor ) ) {
|
||||||
|
fontInfo.backgroundColor = attr;
|
||||||
seenAttributes += 1;
|
seenAttributes += 1;
|
||||||
}
|
}
|
||||||
if ( !fontInfo.family ) {
|
if ( !fontInfo.family && ( attr = style.fontFamily ) ) {
|
||||||
fontInfo.family = style.fontFamily;
|
fontInfo.family = attr;
|
||||||
seenAttributes += 1;
|
seenAttributes += 1;
|
||||||
}
|
}
|
||||||
if ( !fontInfo.size ) {
|
if ( !fontInfo.size && ( attr = style.fontSize ) ) {
|
||||||
fontInfo.size = style.fontSize;
|
fontInfo.size = attr;
|
||||||
seenAttributes += 1;
|
seenAttributes += 1;
|
||||||
}
|
}
|
||||||
element = element.parentNode;
|
element = element.parentNode;
|
||||||
|
|
Loading…
Add table
Reference in a new issue