fixing Polymer elements

This commit is contained in:
DadaMonad 2015-01-16 23:17:19 +00:00
parent bab4bcc94b
commit 02d0ace241
12 changed files with 27 additions and 25 deletions

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

View File

@ -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.

View File

@ -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,

View File

@ -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)

View File

@ -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>

View File

@ -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)

View File

@ -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

File diff suppressed because one or more lines are too long