editor.plugins.UndoRedo.CursorPosition_ Extends
Stores the state of the selection in a way the survives DOM modifications that don't modify the user-interactable content (e.g. making something bold vs. typing a character). TODO(user): Completely get rid of this and use goog.dom.SavedCaretRange.

Inheritance

Constructor

goog.editor.plugins.UndoRedo.CursorPosition_(field)

Parameters

field : goog.editor.Field
The field the selection is in.

Instance Methods

Public Protected Private
getRange_(baseNode) Range | TextRange | null
Get the range that encompases the the cursor position relative to a given base node.
Arguments:
baseNode : Element
The node to get the cursor position relative to.
Returns: Range | TextRange | null  The browser range for this position.
code »
initIE_(range)
In IE, we just keep track of the text offset (number of characters).
Arguments:
range : ?goog.dom.AbstractRange
The range to save.
code »
initW3C_(range)
The standards compliant version keeps a list of childNode offsets.
Arguments:
range : ?goog.dom.AbstractRange
The range to save.
code »
isValid() boolean
No description.
Returns: boolean  Whether this object is valid.
code »
select()
Makes the browser's selection match the cursor position.
code »
toString() string
No description.
Returns: string  A string representation of this object.
code »

Instance Properties

No description.
Code »

Static Methods

goog.editor.plugins.UndoRedo.CursorPosition_.computeEndOffsetIE_(range) number
Compute the number of characters to the end of the range in IE.
Arguments:
range : TextRange
The range to compute an offset for.
Returns: number  The number of characters to the end of the range.
code »

Package editor.plugins.UndoRedo

Package Reference