TinyMCE:API/tinymce.dom.Selection
From Moxiecode Documentation Wiki
Contents |
[edit]
Class: tinymce.dom.Selection
This class handles text and control selection it's an crossbrowser utility class. Consult the TinyMCE Wiki API for more details and examples on how to use this class.
[edit]
Constructor
- Selection
- Constructs a new selection instance.
[edit]
Events
- onBeforeGetContent
- Content extraction event.
- onBeforeSetContent
- Content insertion event.
- onGetContent
- Content extraction event.
- onSetContent
- Content insertion event.
[edit]
Methods
- collapse
- Collapse the selection to start or end of range.
- getBookmark
- Returns a bookmark location for the current selection.
- getContent
- Returns the selected contents using the DOM serializer passed in to this class.
- getEnd
- Returns the end element of a selection range.
- getNode
- Returns the currently selected element or the common ancestor element for both start and end of the selection.
- getRng
- Returns the browser's internal range object.
- getSel
- Returns the browser's internal selection object.
- getStart
- Returns the start element of a selection range.
- isCollapsed
- Returns true/false if the selection range is collapsed or not.
- moveToBookmark
- Restores the selection to the specified bookmark.
- select
- Selects the specified element.
- setContent
- Sets the current selection to the specified content.
- setNode
- Sets the current selection to the specified DOM element.
- setRng
- Changes the selection to the specified DOM range.
