Permalink
Browse files

Merge pull request #15 from redaktor/patch-1

added support for textNode
  • Loading branch information...
kriszyp committed Mar 31, 2014
2 parents ad652a4 + 657c52b commit 18b3827260e8be5146ab4bbcb03d163166c25489
Showing with 6 additions and 1 deletion.
  1. +6 −1 bind.js
View
@@ -119,7 +119,8 @@ define([], function(){
for(var i in this.value){
if(i.charAt(0) != '_'){
callback(i, this.get(i));
- } }
+ }
+ }
},
to: function(source, property){
// Connect this binding to another binding, such that any changes in the source
@@ -239,6 +240,8 @@ define([], function(){
}else{
element.value = value || "";
}
+ }else if(element.nodeType == 3){
+ element.nodeValue = value || "";
}else{
element.innerText = value || "";
}
@@ -301,6 +304,8 @@ define([], function(){
element.onchange = function(){
callback(element.value);
};
+ }else if(element.nodeType == 3){
+ callback(element.nodeValue);
}else{
callback(element.innerText);
}

0 comments on commit 18b3827

Please sign in to comment.