mirror of
https://github.com/fastmail/Squire.git
synced 2025-01-03 05:00:13 -05:00
Preserve inline styles on enter in WebKit.
This commit is contained in:
parent
da49316876
commit
d5e8ef1381
3 changed files with 16 additions and 4 deletions
|
@ -314,7 +314,13 @@ function fixCursor ( node ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( isInline( node ) ) {
|
if ( isInline( node ) ) {
|
||||||
if ( !node.firstChild ) {
|
child = node.firstChild;
|
||||||
|
while ( cantFocusEmptyTextNodes && child &&
|
||||||
|
child.nodeType === TEXT_NODE && !child.data ) {
|
||||||
|
node.removeChild( child );
|
||||||
|
child = node.firstChild;
|
||||||
|
}
|
||||||
|
if ( !child ) {
|
||||||
if ( cantFocusEmptyTextNodes ) {
|
if ( cantFocusEmptyTextNodes ) {
|
||||||
fixer = doc.createTextNode( '\u200B' );
|
fixer = doc.createTextNode( '\u200B' );
|
||||||
if ( win.editor ) {
|
if ( win.editor ) {
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -172,7 +172,13 @@ function fixCursor ( node ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( isInline( node ) ) {
|
if ( isInline( node ) ) {
|
||||||
if ( !node.firstChild ) {
|
child = node.firstChild;
|
||||||
|
while ( cantFocusEmptyTextNodes && child &&
|
||||||
|
child.nodeType === TEXT_NODE && !child.data ) {
|
||||||
|
node.removeChild( child );
|
||||||
|
child = node.firstChild;
|
||||||
|
}
|
||||||
|
if ( !child ) {
|
||||||
if ( cantFocusEmptyTextNodes ) {
|
if ( cantFocusEmptyTextNodes ) {
|
||||||
fixer = doc.createTextNode( '\u200B' );
|
fixer = doc.createTextNode( '\u200B' );
|
||||||
if ( win.editor ) {
|
if ( win.editor ) {
|
||||||
|
|
Loading…
Reference in a new issue