DomBinding
Extends:
A binding that binds the children of a YXmlFragment to a DOM element.
This binding is automatically destroyed when its parent is deleted.
Example:
const div = document.createElement('div')
const type = y.define('xml', Y.XmlFragment)
const binding = new Y.QuillBinding(type, div)
Constructor Summary
Public Constructor | ||
public |
constructor(type: YXmlFragment, target: Element, opts: Object) |
Member Summary
Public Members | ||
public |
Maps each DOM element to the type that it is associated with. |
|
public |
Defines which DOM attributes and elements to filter out. |
|
public |
opts: * |
|
public |
|
|
public |
Maps each YXml type to the DOM element that it is associated with. |
Method Summary
Public Methods | ||
public |
destroy() Remove all properties that are handled by this class. |
|
public |
setFilter(filter: FilterFunction) NOTE: currently does not apply filter to existing elements! |
Inherited Summary
From class Binding | ||
public |
target: * The target that |
|
public |
type: YType The Yjs type that is bound to |
|
public |
destroy() Remove all data observers (both from the type and the target). |
Public Constructors
public constructor(type: YXmlFragment, target: Element, opts: Object) source
Override:
Binding#constructorParams:
Name | Type | Attribute | Description |
type | YXmlFragment | The bind source. This is the ultimate source of truth. |
|
target | Element | The bind target. Mirrors the target. |
|
opts | Object |
|
Optional configurations |
opts.filter | FilterFunction |
|
The filter function to use. |
Public Members
public filter: FilterFunction source
Defines which DOM attributes and elements to filter out. Also filters remote changes.
public opts: * source
public scrollingElement: * source
Public Methods
public destroy() source
Remove all properties that are handled by this class.
Override:
Binding#destroypublic setFilter(filter: FilterFunction) source
NOTE: currently does not apply filter to existing elements!
Params:
Name | Type | Attribute | Description |
filter | FilterFunction | The filter function to use from now on. |