Skip to content

Commit

Permalink
Merge pull request #15 from redaktor/patch-1
Browse files Browse the repository at this point in the history
added support for textNode
  • Loading branch information
kriszyp committed Mar 31, 2014
2 parents ad652a4 + 657c52b commit 18b3827
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion bind.js
Expand Up @@ -119,7 +119,8 @@ define([], function(){
for(var i in this.value){ for(var i in this.value){
if(i.charAt(0) != '_'){ if(i.charAt(0) != '_'){
callback(i, this.get(i)); callback(i, this.get(i));
} } }
}
}, },
to: function(source, property){ to: function(source, property){
// Connect this binding to another binding, such that any changes in the source // Connect this binding to another binding, such that any changes in the source
Expand Down Expand Up @@ -239,6 +240,8 @@ define([], function(){
}else{ }else{
element.value = value || ""; element.value = value || "";
} }
}else if(element.nodeType == 3){
element.nodeValue = value || "";
}else{ }else{
element.innerText = value || ""; element.innerText = value || "";
} }
Expand Down Expand Up @@ -301,6 +304,8 @@ define([], function(){
element.onchange = function(){ element.onchange = function(){
callback(element.value); callback(element.value);
}; };
}else if(element.nodeType == 3){
callback(element.nodeValue);
}else{ }else{
callback(element.innerText); callback(element.innerText);
} }
Expand Down

0 comments on commit 18b3827

Please sign in to comment.