0
Fork 0
mirror of https://github.com/fastmail/Squire.git synced 2025-01-20 05:32:46 -05:00

Fix whitespace errors.

Thanks to @gertsonderby who pointed these out in #138.
This commit is contained in:
Neil Jenkins 2015-09-28 15:48:23 +02:00
parent 0ec3c43791
commit 9461368a5c
3 changed files with 12 additions and 12 deletions

View file

@ -698,7 +698,7 @@ var insertNodeInRange = function ( range, node ) {
childCount = children.length; childCount = children.length;
if ( startOffset === childCount) { if ( startOffset === childCount ) {
startContainer.appendChild( node ); startContainer.appendChild( node );
} else { } else {
startContainer.insertBefore( node, children[ startOffset ] ); startContainer.insertBefore( node, children[ startOffset ] );
@ -2734,7 +2734,7 @@ proto._recordUndoState = function ( range ) {
undoStack = this._undoStack; undoStack = this._undoStack;
// Truncate stack if longer (i.e. if has been previously undone) // Truncate stack if longer (i.e. if has been previously undone)
if ( undoIndex < this._undoStackLength) { if ( undoIndex < this._undoStackLength ) {
undoStack.length = this._undoStackLength = undoIndex; undoStack.length = this._undoStackLength = undoIndex;
} }
@ -2898,9 +2898,9 @@ proto._addFormat = function ( tag, attributes, range ) {
SHOW_TEXT|SHOW_ELEMENT, SHOW_TEXT|SHOW_ELEMENT,
function ( node ) { function ( node ) {
return ( node.nodeType === TEXT_NODE || return ( node.nodeType === TEXT_NODE ||
node.nodeName === 'BR'|| node.nodeName === 'BR' ||
node.nodeName === 'IMG' ) && node.nodeName === 'IMG'
isNodeContainedInRange( range, node, true ); ) && isNodeContainedInRange( range, node, true );
}, },
false false
); );

View file

@ -610,7 +610,7 @@ proto._recordUndoState = function ( range ) {
undoStack = this._undoStack; undoStack = this._undoStack;
// Truncate stack if longer (i.e. if has been previously undone) // Truncate stack if longer (i.e. if has been previously undone)
if ( undoIndex < this._undoStackLength) { if ( undoIndex < this._undoStackLength ) {
undoStack.length = this._undoStackLength = undoIndex; undoStack.length = this._undoStackLength = undoIndex;
} }
@ -774,9 +774,9 @@ proto._addFormat = function ( tag, attributes, range ) {
SHOW_TEXT|SHOW_ELEMENT, SHOW_TEXT|SHOW_ELEMENT,
function ( node ) { function ( node ) {
return ( node.nodeType === TEXT_NODE || return ( node.nodeType === TEXT_NODE ||
node.nodeName === 'BR'|| node.nodeName === 'BR' ||
node.nodeName === 'IMG' ) && node.nodeName === 'IMG'
isNodeContainedInRange( range, node, true ); ) && isNodeContainedInRange( range, node, true );
}, },
false false
); );

View file

@ -66,7 +66,7 @@ var insertNodeInRange = function ( range, node ) {
childCount = children.length; childCount = children.length;
if ( startOffset === childCount) { if ( startOffset === childCount ) {
startContainer.appendChild( node ); startContainer.appendChild( node );
} else { } else {
startContainer.insertBefore( node, children[ startOffset ] ); startContainer.insertBefore( node, children[ startOffset ] );