updated examples
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
// create a shared object. This function call will return a promise!
|
||||
Y({
|
||||
db: {
|
||||
name: 'IndexedDB',
|
||||
name: 'indexeddb',
|
||||
namespace: 'offlineEditingDemo'
|
||||
},
|
||||
connector: {
|
||||
@@ -11,8 +11,8 @@ Y({
|
||||
room: 'offlineEditingDemo',
|
||||
debug: true
|
||||
},
|
||||
types: [],
|
||||
sourceDir: '/bower_components/'
|
||||
types: ['Array', 'Text'],
|
||||
sourceDir: '/bower_components'
|
||||
}).then(function (yconfig) {
|
||||
// yconfig holds all the information about the shared object
|
||||
window.yconfig = yconfig
|
||||
@@ -33,10 +33,10 @@ Y({
|
||||
text.bind(contenteditable)
|
||||
}
|
||||
})
|
||||
// create a shared TextBind
|
||||
// create a shared Text
|
||||
var textpromise = yconfig.root.get('text')
|
||||
if (textpromise == null) {
|
||||
yconfig.root.set('text', Y.TextBind)
|
||||
yconfig.root.set('text', Y.Text)
|
||||
}
|
||||
// We also provide a button for disconnecting/reconnecting the shared element
|
||||
var button = document.querySelector('#button')
|
||||
|
||||
Reference in New Issue
Block a user