fixing Polymer elements
This commit is contained in:
parent
bab4bcc94b
commit
02d0ace241
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -2,4 +2,6 @@
|
||||
|
||||
Here you find some (hopefully) usefull examples on how to use Yatta!
|
||||
|
||||
Please note, that the XMPP Connector is the best supported Connector at the moment.
|
||||
Please note, that the XMPP Connector is the best supported Connector at the moment.
|
||||
|
||||
Note: currently only the XMPP stuff is supported.
|
@ -30,8 +30,8 @@ var yatta, yattaHandler;
|
||||
For now, you can use my API key.
|
||||
*/
|
||||
|
||||
connector = new XMPPConnector();
|
||||
|
||||
connector = new XMPPConnector("testy-xmpp-json");
|
||||
connector.debug = true
|
||||
/**
|
||||
### Yatta
|
||||
yatta is the shared json object. If you change something on this object,
|
||||
|
@ -5,15 +5,15 @@ setTimeout(function(){
|
||||
x.yatta.val("stuff",{otherstuff:{nostuff:"this is no stuff"}})
|
||||
setTimeout(function(){
|
||||
var res = x.yatta.val("stuff");
|
||||
if(!(x.nostuff.val() === "this is no stuff")){
|
||||
console.log("Deep inherit doesn't work")
|
||||
if(!(x.nostuff === "this is no stuff")){
|
||||
console.log("Deep inherit doesn't work!")
|
||||
}
|
||||
window.y_stuff_property.val = {nostuff: "this is also no stuff"};
|
||||
setTimeout(function(){
|
||||
if(!(x.nostuff.val() === "this is also no stuff")){
|
||||
if(!(x.nostuff === "this is also no stuff")){
|
||||
console.log("Element val overwrite doesn't work")
|
||||
}
|
||||
console.log("res");
|
||||
console.log("Everything is fine :)");
|
||||
},500)
|
||||
},500);
|
||||
},3000)
|
@ -4,7 +4,7 @@
|
||||
|
||||
<polymer-element name="yatta-test" attributes="yatta connector stuff">
|
||||
<template>
|
||||
<xmpp-connector id="connector" connector={{connector}}></xmpp-connector>
|
||||
<xmpp-connector id="connector" connector={{connector}} room="testy-xmpp-polymer"></xmpp-connector>
|
||||
<yatta-element connector={{connector}} val={{yatta}}>
|
||||
<yatta-property name="slider" val={{slider}}>
|
||||
</yatta-property>
|
||||
|
@ -320,7 +320,7 @@ module.exports = (HB)->
|
||||
else
|
||||
char = event.key
|
||||
else
|
||||
char = String.fromCharCode event.keyCode
|
||||
char = window.String.fromCharCode event.keyCode
|
||||
if char.length > 0
|
||||
pos = Math.min textfield.selectionStart, textfield.selectionEnd
|
||||
diff = Math.abs(textfield.selectionEnd - textfield.selectionStart)
|
||||
|
@ -25,7 +25,7 @@ Polymer "yatta-element",
|
||||
bindToChildren @
|
||||
|
||||
valChanged: ()->
|
||||
if @val? and @val.type is "JsonType"
|
||||
if @val? and @val.type is "Object"
|
||||
bindToChildren @
|
||||
|
||||
connectorChanged: ()->
|
||||
@ -42,7 +42,7 @@ Polymer "yatta-property",
|
||||
# since it is more safe (consider someone putting a custom Object type here)
|
||||
else if typeof @val is "string"
|
||||
@parentElement.val(@name,@val)
|
||||
if @val.type is "JsonType"
|
||||
if @val.type is "Object"
|
||||
bindToChildren @
|
||||
|
||||
valChanged: ()->
|
||||
@ -51,7 +51,7 @@ Polymer "yatta-property",
|
||||
@val = @parentElement.val.val(@name,@val).val(@name)
|
||||
# TODO: please use instanceof instead of .type,
|
||||
# since it is more safe (consider someone putting a custom Object type here)
|
||||
else if @val.type is "JsonType"
|
||||
else if @val.type is "Object"
|
||||
bindToChildren @
|
||||
else if @parentElement.val?.val? and @val isnt @parentElement.val.val(@name)
|
||||
@parentElement.val.val @name, @val
|
||||
|
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user