Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use "body" as root rendering element

  • Loading branch information...
commit b5b2fa5d457c1ac2ad8d318e077c62293bf39456 1 parent b0b593d
@kriszyp authored
Showing with 6 additions and 3 deletions.
  1. +2 −0  dbind.br
  2. +1 −1  dbind.js
  3. +3 −2 test/basic.js
View
2  dbind.br
@@ -12,6 +12,8 @@ password: element(input,password);
date: element(input,date);
span: element(span);
div: element(div);
+li: element(li);
+ul: element(ul);
full-layout: {
[
top: pane {
View
2  dbind.js
@@ -8,7 +8,7 @@ define(['./Cascade', './ReactiveObject', './env', './parser', './element'], func
root.source = new ReactiveObject(data);
}
parser({text: sheet}, root);
- return get(root, "-element");
+ return get(root, "body", "-element");
}
function createRoot(domElement){
var root = new Cascade;
View
5 test/basic.js
@@ -6,7 +6,7 @@ define(['../dbind', 'put-selector/put', 'dojo/Stateful', '../Cascade'], function
age: 33
});
var target = get(dbind(put(document.body, 'div'), obj,
- '[span + source/name { color: green; };' +
+ 'element: module(bindr/element); span: element(span); div: element(div); body: [span + source/name { color: green; };' +
'div + source/age { font-weight: bold}]'), function(target){
console.assert(target.firstChild.tagName == 'SPAN');
console.assert(target.firstChild.innerHTML == 'Mike');
@@ -16,7 +16,8 @@ define(['../dbind', 'put-selector/put', 'dojo/Stateful', '../Cascade'], function
console.assert(getComputedStyle(target.firstChild.nextSibling).fontWeight == 'bold');
});
var target = get(dbind(put(document.body, 'div'), obj,
- '[div { ' +
+ 'element: module(bindr/element); div: element(div); label: element(label); text-box: element(input,text); ' +
+ 'body: [div { ' +
'person-label: label { color: green};' +
'[person-label + "Name:",' +
'text-box + source/name,' +
Please sign in to comment.
Something went wrong with that request. Please try again.