From 9461368a5c524d072b0e3925faac38cb31e5787c Mon Sep 17 00:00:00 2001 From: Neil Jenkins Date: Mon, 28 Sep 2015 15:48:23 +0200 Subject: [PATCH] Fix whitespace errors. Thanks to @gertsonderby who pointed these out in #138. --- build/squire-raw.js | 12 ++++++------ source/Editor.js | 10 +++++----- source/Range.js | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/build/squire-raw.js b/build/squire-raw.js index c165eaf1..913c781 100644 --- a/build/squire-raw.js +++ b/build/squire-raw.js @@ -698,7 +698,7 @@ var insertNodeInRange = function ( range, node ) { childCount = children.length; - if ( startOffset === childCount) { + if ( startOffset === childCount ) { startContainer.appendChild( node ); } else { startContainer.insertBefore( node, children[ startOffset ] ); @@ -2705,7 +2705,7 @@ proto._keyUpDetectChange = function ( event ) { // 3. The key pressed is not in range 33<=x<=45 (navigation keys) if ( !event.ctrlKey && !event.metaKey && !event.altKey && ( code < 16 || code > 20 ) && - ( code < 33 || code > 45 ) ) { + ( code < 33 || code > 45 ) ) { this._docWasChanged(); } }; @@ -2734,7 +2734,7 @@ proto._recordUndoState = function ( range ) { undoStack = this._undoStack; // Truncate stack if longer (i.e. if has been previously undone) - if ( undoIndex < this._undoStackLength) { + if ( undoIndex < this._undoStackLength ) { undoStack.length = this._undoStackLength = undoIndex; } @@ -2898,9 +2898,9 @@ proto._addFormat = function ( tag, attributes, range ) { SHOW_TEXT|SHOW_ELEMENT, function ( node ) { return ( node.nodeType === TEXT_NODE || - node.nodeName === 'BR'|| - node.nodeName === 'IMG' ) && - isNodeContainedInRange( range, node, true ); + node.nodeName === 'BR' || + node.nodeName === 'IMG' + ) && isNodeContainedInRange( range, node, true ); }, false ); diff --git a/source/Editor.js b/source/Editor.js index 8aabcfd..a7ba2dd 100644 --- a/source/Editor.js +++ b/source/Editor.js @@ -581,7 +581,7 @@ proto._keyUpDetectChange = function ( event ) { // 3. The key pressed is not in range 33<=x<=45 (navigation keys) if ( !event.ctrlKey && !event.metaKey && !event.altKey && ( code < 16 || code > 20 ) && - ( code < 33 || code > 45 ) ) { + ( code < 33 || code > 45 ) ) { this._docWasChanged(); } }; @@ -610,7 +610,7 @@ proto._recordUndoState = function ( range ) { undoStack = this._undoStack; // Truncate stack if longer (i.e. if has been previously undone) - if ( undoIndex < this._undoStackLength) { + if ( undoIndex < this._undoStackLength ) { undoStack.length = this._undoStackLength = undoIndex; } @@ -774,9 +774,9 @@ proto._addFormat = function ( tag, attributes, range ) { SHOW_TEXT|SHOW_ELEMENT, function ( node ) { return ( node.nodeType === TEXT_NODE || - node.nodeName === 'BR'|| - node.nodeName === 'IMG' ) && - isNodeContainedInRange( range, node, true ); + node.nodeName === 'BR' || + node.nodeName === 'IMG' + ) && isNodeContainedInRange( range, node, true ); }, false ); diff --git a/source/Range.js b/source/Range.js index 9eac669..e8a05ef 100644 --- a/source/Range.js +++ b/source/Range.js @@ -66,7 +66,7 @@ var insertNodeInRange = function ( range, node ) { childCount = children.length; - if ( startOffset === childCount) { + if ( startOffset === childCount ) { startContainer.appendChild( node ); } else { startContainer.insertBefore( node, children[ startOffset ] );