Code Index | File Index

Namespaces

Classes


Class CKEDITOR.dom.selection


Defined in: plugins/selection/plugin.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Manipulates the selection in a DOM document.
Field Summary
Field Attributes Field Name and Description
 
Gets the native selection object from the browser.
 
Gets the type of the current selection.
Method Summary
Method Attributes Method Name and Description
 
Gets the current selected element.
 
Gets the DOM element in which the selection starts.
Class Detail
CKEDITOR.dom.selection(document)
Since: 3.0
Manipulates the selection in a DOM document.
Parameters:
document
Field Detail
{Object} getNative
Since: 3.0
Gets the native selection object from the browser.
var selection = editor.getSelection().getNative();

{Number} getType
Since: 3.0
Gets the type of the current selection. The following values are available:
if ( editor.getSelection().getType() == CKEDITOR.SELECTION_TEXT )
    alert( 'Text is selected' );
Method Detail
{CKEDITOR.dom.element} getSelectedElement()
Since: 3.0
Gets the current selected element.
var element = editor.getSelection().getSelectedElement();
alert( element.getName() );
Returns:
{CKEDITOR.dom.element} The selected element. Null if no selection is available or the selection type is not CKEDITOR.SELECTION_ELEMENT.

{CKEDITOR.dom.element} getStartElement()
Since: 3.0
Gets the DOM element in which the selection starts.
var element = editor.getSelection().getStartElement();
alert( element.getName() );
Returns:
{CKEDITOR.dom.element} The element at the beginning of the selection.

Documentation generated by JsDoc Toolkit