PropertySelection
Class defined in model/PropertySelection.js#20 inherits from

A selection which is bound to a property. Implements model/Selection.

Example

    var propSel = doc.createSelection({
      type: 'property',
      path: ['p1', 'content'],
      startOffset: 3,
      endOffset: 6
    });

new PropertySelection()
Constructor defined in model/PropertySelection.js#30
this.toJSON()
Method defined in model/PropertySelection.js#80

Convert container selection to JSON.

Returns

Object |

this.collapse(direction)
Method defined in model/PropertySelection.js#136

Collapse a selection to chosen direction.

Parameters

direction | String | either left of right

Returns

PropertySelection |

this.getPath()
Method defined in model/PropertySelection.js#158

Get path of a selection, e.g. target property where selected data is stored.

Returns

String[] | path

this.getStartOffset()
Method defined in model/PropertySelection.js#171

Get start character position.

Returns

Number | offset

this.getEndOffset()
Method defined in model/PropertySelection.js#180

Get end character position.

Returns

Number | offset

this.isInsideOf(other, strict)
Method defined in model/PropertySelection.js#191

Checks if this selection is inside another one.

Parameters

other | Selection |
[strict] | Boolean | true if should check that it is strictly inside the other

Returns

Boolean |

this.contains(other, strict)
Method defined in model/PropertySelection.js#214

Checks if this selection contains another one.

Parameters

other | Selection |
[strict] | Boolean | true if should check that it is strictly contains the other

Returns

Boolean |

this.overlaps(other, strict)
Method defined in model/PropertySelection.js#226

Checks if this selection overlaps another one.

Parameters

other | Selection |
[strict] | Boolean | true if should check that it is strictly overlaps the other

Returns

Boolean |

this.isRightAlignedWith(other)
Method defined in model/PropertySelection.js#246

Checks if this selection has the right boundary in common with another one.

Parameters

other | Selection |

Returns

Boolean |

this.isLeftAlignedWith(other)
Method defined in model/PropertySelection.js#262

Checks if this selection has the left boundary in common with another one.

Parameters

other | Selection |

Returns

Boolean |

this.expand(other)
Method defined in model/PropertySelection.js#278

Expands selection to include another selection.

Parameters

other | Selection |

Returns

Selection | a new selection

this.truncateWith(other)
Method defined in model/PropertySelection.js#301

Creates a new selection by truncating this one by another selection.

Parameters

other | Selection |

Returns

Selection | a new selection

this.createWithNewRange(startOffset, endOffset)
Method defined in model/PropertySelection.js#368

Creates a new selection with given range and same path.

Parameters

startOffset | Number |
endOffset | Number |

Returns

Selection | a new selection

this.getFragments()
Method defined in model/PropertySelection.js#382

Return fragments for a given selection.

Returns

Selection.Fragment[] |