new DomBinding(type, target, optsopt)
Parameters:
| Name | Type | Attributes | Description | |||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
type |
YXmlFragment | The bind source. This is the ultimate source of truth. |
||||||||||||||||||||||||||
target |
Element | The bind target. Mirrors the target. |
||||||||||||||||||||||||||
opts |
Object |
<optional> |
Optional configurations Properties
|
Example
const div = document.createElement('div')
const type = y.define('xml', Y.XmlFragment)
const binding = new Y.QuillBinding(type, div)
Members
-
domToType :Map
-
Maps each DOM element to the type that it is associated with.
-
filter :DomFilter
-
Defines which DOM attributes and elements to filter out. Also filters remote changes.
-
target :Element
-
The target that
typeis bound to. -
type :YXmlFragment
-
The Yjs type that is bound to
target -
typeToDom :Map
-
Maps each YXml type to the DOM element that it is associated with.
Methods
-
destroy()
-
Remove all properties that are handled by this class.
-
setFilter(filter)
-
NOTE:
- does not apply filter to existing elements!
- only guarantees that changes are filtered locally. Remote sites may see different content.
Parameters:
Name Type Description filterDomFilter The filter function to use from now on.