ContentEditable Class
Creates a component to work with an elemment.
Constructor
ContentEditable
()
Item Index
Properties
- DOM_EVENTS static
- HTML static
- NAME static
- NS static
- THROTTLE_TIME static
Methods
delegate
-
type
-
fn
-
cont
-
sel
A delegate method passed to the instance's delegate method
Parameters:
Returns:
The Event handle returned from Y.delegate
focus
-
fn
Set the focus to the container
Parameters:
-
fn
FunctionCallback function to execute after focus happens
Returns:
getInstance
()
YUI
Get a reference to the internal YUI instance.
Returns:
The internal YUI instance
render
-
node
Parameters:
-
node
String/HTMLElement/NodeThe node to render to
Returns:
use
()
This is a scoped version of the normal YUI.use method & is bound to the ContentEditable element At setup, the inst.use method is mapped to this method.
Properties
NS
String
static
The namespace on which ContentEditable plugin will reside.
Default: 'contentEditable'
Attributes
container
String/HTMLElement/Node
The container to set contentEditable=true or to create on render.
Fires event containerChange
Fires when the value for the configuration attribute container
is
changed. You can listen for the event using the on
method if you
wish to be notified before the attribute's value has changed, or
using the after
method if you wish to be notified after the
attribute's value has changed.
Parameters:
-
e
EventFacadeAn Event Facade object with the following attribute-specific properties added:
content
String
The string to inject as Editor content. Default '
'
Fires event contentChange
Fires when the value for the configuration attribute content
is
changed. You can listen for the event using the on
method if you
wish to be notified before the attribute's value has changed, or
using the after
method if you wish to be notified after the
attribute's value has changed.
Parameters:
-
e
EventFacadeAn Event Facade object with the following attribute-specific properties added:
defaultblock
String
The default tag to use for block level items, defaults to: p
Fires event defaultblockChange
Fires when the value for the configuration attribute defaultblock
is
changed. You can listen for the event using the on
method if you
wish to be notified before the attribute's value has changed, or
using the after
method if you wish to be notified after the
attribute's value has changed.
Parameters:
-
e
EventFacadeAn Event Facade object with the following attribute-specific properties added:
dir
String
The default text direction for this ContentEditable element. Default: ltr
Fires event dirChange
Fires when the value for the configuration attribute dir
is
changed. You can listen for the event using the on
method if you
wish to be notified before the attribute's value has changed, or
using the after
method if you wish to be notified after the
attribute's value has changed.
Parameters:
-
e
EventFacadeAn Event Facade object with the following attribute-specific properties added:
extracss
String
A string of CSS to add to the Head of the Editor
Fires event extracssChange
Fires when the value for the configuration attribute extracss
is
changed. You can listen for the event using the on
method if you
wish to be notified before the attribute's value has changed, or
using the after
method if you wish to be notified after the
attribute's value has changed.
Parameters:
-
e
EventFacadeAn Event Facade object with the following attribute-specific properties added:
id
String
Set the id of the new Node. (optional)
Fires event idChange
Fires when the value for the configuration attribute id
is
changed. You can listen for the event using the on
method if you
wish to be notified before the attribute's value has changed, or
using the after
method if you wish to be notified after the
attribute's value has changed.
Parameters:
-
e
EventFacadeAn Event Facade object with the following attribute-specific properties added:
lang
String
The default language. Default: en-US
Fires event langChange
Fires when the value for the configuration attribute lang
is
changed. You can listen for the event using the on
method if you
wish to be notified before the attribute's value has changed, or
using the after
method if you wish to be notified after the
attribute's value has changed.
Parameters:
-
e
EventFacadeAn Event Facade object with the following attribute-specific properties added:
linkedcss
String | Array
An array of url's to external linked style sheets
Fires event linkedcssChange
Fires when the value for the configuration attribute linkedcss
is
changed. You can listen for the event using the on
method if you
wish to be notified before the attribute's value has changed, or
using the after
method if you wish to be notified after the
attribute's value has changed.
Parameters:
-
e
EventFacadeAn Event Facade object with the following attribute-specific properties added:
node
Node
The Node instance of the container.
Fires event nodeChange
Fires when the value for the configuration attribute node
is
changed. You can listen for the event using the on
method if you
wish to be notified before the attribute's value has changed, or
using the after
method if you wish to be notified after the
attribute's value has changed.
Parameters:
-
e
EventFacadeAn Event Facade object with the following attribute-specific properties added:
use
Array
Array of modules to include in the scoped YUI instance at render time. Default: ['node-base', 'editor-selection', 'stylesheet']
Fires event useChange
Fires when the value for the configuration attribute use
is
changed. You can listen for the event using the on
method if you
wish to be notified before the attribute's value has changed, or
using the after
method if you wish to be notified after the
attribute's value has changed.
Parameters:
-
e
EventFacadeAn Event Facade object with the following attribute-specific properties added: