Extends
Constructor
new ve.ui.TargetWidget([config])abstract
#
Hierarchy
Creates an ve.ui.TargetWidget object.
User must call #initialize after the widget has been attached to the DOM, and also after the document is changed with #setDocument.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
config |
Object |
optional |
Configuration options Properties:
|
- Mixes in:
- Source:
Methods
clear()
#
Destroy surface and toolbar.
createTarget() → {ve.init.Target}
#
focus()
#
Focus the surface.
getSurface() → {ve.ui.Surface|null
}
#
null
}
#
getToolbar() → {OO.ui.Toolbar}
#
hasBeenModified() → {boolean}
#
Check if the surface has been modified.
Returns:
The surface has been modified
- Type
- boolean
initialize()
#
Initialize surface and toolbar.
Widget must be attached to DOM before initializing.
- Deprecated:
- Yes
- Source:
isReadOnly() → {boolean}
#
Check if the widget is read-only
Returns:
- Type
- boolean
onFocusChange()
#
Handle focus and blur events
onSurfaceCancel()
#
Handle surface cancel events
Fires:
onSurfaceSubmit()
#
Handle surface submit events
Fires:
setDocument(doc)
#
Set the document to edit
This replaces the entire surface in the target.
Parameters:
Name | Type | Description |
---|---|---|
doc |
ve.dm.Document |
Fires:
Set the document to edit
This replaces the entire surface in the target.
setReadOnly(readOnly)
#
Set the read-only state of the widget
Parameters:
Name | Type | Description |
---|---|---|
readOnly |
boolean | Make widget read-only |
Events
cancel()
#
The target's surface has been cancelled, e.g. Escape
change()
#
The target's surface has been changed.
setup()
#
A document has been attached to the target, and a toolbar and surface created.
submit()
#
The target's surface has been submitted, e.g. Ctrl+Enter