mirror of
https://github.com/fastmail/Squire.git
synced 2025-01-03 05:00:13 -05:00
Tidy IE8 range code.
This commit is contained in:
parent
c964a6a564
commit
630a7c4e4f
2 changed files with 5 additions and 7 deletions
File diff suppressed because one or more lines are too long
|
@ -16,7 +16,6 @@ var indexOf = Array.prototype.indexOf;
|
|||
|
||||
var START_TO_START = 0;
|
||||
var START_TO_END = 1;
|
||||
var END_TO_END = 2;
|
||||
var END_TO_START = 3;
|
||||
|
||||
var contains = function ( a, b ) {
|
||||
|
@ -342,13 +341,12 @@ var getTextRangeBoundaryPosition = function (
|
|||
if ( nextNode && isCharacterDataNode( nextNode ) ) {
|
||||
boundaryPosition = new DomPosition( nextNode, 0 );
|
||||
} else if ( previousNode && isCharacterDataNode( previousNode ) ) {
|
||||
// Strange bug; if we don't read the data property, the length
|
||||
// Strange bug: if we don't read the data property, the length
|
||||
// property is often returned incorrectly as 0. Don't ask me why.
|
||||
/*jshint expr: true */
|
||||
previousNode.data;
|
||||
/*jshint expr: false */
|
||||
// Therefore get the length from the data property rather than
|
||||
// reading it directly from the node.
|
||||
boundaryPosition = new DomPosition(
|
||||
previousNode, previousNode.length );
|
||||
previousNode, previousNode.data.length );
|
||||
} else {
|
||||
boundaryPosition = new DomPosition(
|
||||
containerElement,
|
||||
|
|
Loading…
Reference in a new issue