Members
Direction :number
Type:
- number
Properties:
Name | Type | Description |
---|---|---|
FORWARD |
number | |
BACKWARD |
number |
- Source:
isDirty
- Source:
Methods
_handleMutations()
for each mutation:
- find the target nodes:
- if nodes changed, target nodes are:
- added nodes
- the target from which removed nodes were removed
- if character data changed
- target node is the mutation event's target (text node)
- filter out nodes that are no longer attached (parentNode is null)
- if nodes changed, target nodes are:
- for each remaining node:
- find its section, add to sections-to-reparse
- if no section, reparse all (and break)
- Source:
findRenderNodeFromElement(element)
Parameters:
Name | Type | Description |
---|---|---|
element |
DOMNode | Walk up from the dom element until we find a renderNode element |
- Source:
headPosition() → {Position}
- Source:
Returns:
The position at the start of this section
- Type
- Position
join(other)
Mutates this list
Parameters:
Name | Type | Description |
---|---|---|
other |
ListSection | Markerable |
- Source:
Returns:
null
markersFor() → {Array}
- Source:
Returns:
New markers that match the boundaries of the range. Does not change the existing markers in this section.
- Type
- Array
offsetOfMarker(marker, markerOffset) → {Number}
Parameters:
Name | Type | Default | Description |
---|---|---|---|
marker |
Marker | ||
markerOffset |
Number | 0 | The offset relative to the start of the marker |
- Source:
Returns:
The offset relative to the start of this section
- Type
- Number
parse(text) → {Post}
Parameters:
Name | Type | Description |
---|---|---|
text |
String | to parse |
- Source:
Returns:
a post abstract
- Type
- Post
parse() → {Post}
Parameters:
Type | Description |
---|---|
Mobiledoc |
- Source:
Returns:
- Type
- Post
parse() → {Post}
Parameters:
Type | Description |
---|---|
Mobiledoc |
- Source:
Returns:
- Type
- Post
parse(html) → {Post}
Parameters:
Name | Type | Description |
---|---|---|
html |
String | to parse |
- Source:
Returns:
A post abstract
- Type
- Post
parse() → {Post}
Parameters:
Type | Description |
---|---|
Mobiledoc |
- Source:
Returns:
- Type
- Post
replaceWithHeaderSection(editor, headingTagName)
Convert section at the editor's cursor position into a header section. Does nothing if the cursor position is not at the start of the section.
Parameters:
Name | Type | Description |
---|---|---|
editor |
Editor | |
headingTagName |
String | ('h1', 'h2', 'h3', 'h4', 'h5', 'h6') |
- Source:
replaceWithListSection(editor, listTagName)
Convert section at the editor's cursor position into a list. Does nothing if the cursor position is not at the start of the section, or if the section is already a list item.
Parameters:
Name | Type | Description |
---|---|---|
editor |
Editor | |
listTagName |
String | ("ul" or "ol") |
- Source:
splitMarkerAtOffset(sectionOffset) → {EditObject}
Split this section's marker (if any) at the given offset, so that there is now a marker boundary at that offset (useful for later applying a markup to a range)
Parameters:
Name | Type | Description |
---|---|---|
sectionOffset |
Number | The offset relative to start of this section |
- Source:
Returns:
An edit object with 'removed' and 'added' keys with arrays of Markers. The added markers may be blank.
After calling splitMarkerAtOffset(offset)
, there will always be a valid
result returned from markerBeforeOffset(offset)
.
- Type
- EditObject
splitMarkerAtOffset()
Markerable sections should override this method
- Source:
tailPosition() → {Position}
- Source:
Returns:
The position at the end of this section
- Type
- Position
toPosition(offset) → {Position}
Parameters:
Name | Type | Description |
---|---|---|
offset |
Number |
- Source:
Returns:
The position in this section at the given offset
- Type
- Position
toRange() → {Range}
- Source:
Returns:
A range from this section's head to tail positions
- Type
- Range