mirror of
https://github.com/yjs/yjs.git
synced 2025-12-29 00:25:01 +01:00
last bug fixes for TextBind type (for now)
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
<script src="./index.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1 contentEditable> yjs Tutorial</h1>
|
||||
<h1 id="contenteditable" contentEditable> yjs Tutorial</h1>
|
||||
<p> Collaborative Json editing with <a href="https://github.com/rwth-acis/yjs/">yjs</a>
|
||||
and XMPP Connector. </p>
|
||||
|
||||
|
||||
@@ -12,12 +12,14 @@ Y({
|
||||
window.y = yconfig.root;
|
||||
window.yconfig = yconfig;
|
||||
var textarea = document.getElementById("textfield");
|
||||
var contenteditable = document.getElementById("contenteditable");
|
||||
yconfig.root.observe(function(events){
|
||||
for (var e in events) {
|
||||
var event = events[e];
|
||||
if (event.name === "text" && (event.type === "add" || event.type === "update")) {
|
||||
event.object.get(event.name).then(function(text){ //eslint-disable-line
|
||||
text.bind(textarea);
|
||||
text.bind(contenteditable);
|
||||
window.ytext = text;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user