Browse files

The 'column' classname is just noise, so rewrite the output to not in…

…clude it (and make the HTML rendering recurse properly)
  • Loading branch information...
1 parent 56177dd commit c6c6dc72cf3a806255241cef38424ed42204ad67 @mdaines mdaines committed May 23, 2009
Showing with 9 additions and 10 deletions.
  1. +0 −1 src/plumb/output.js
  2. +9 −9 www/index.html
View
1 src/plumb/output.js
@@ -19,7 +19,6 @@ Plumb.Output = {
this.output(child, element);
} else {
container.insert(element);
- element.addClassName("column");
element.setStyle({ height: child.height + "px" });
}
}.bind(this));
View
18 www/index.html
@@ -44,27 +44,27 @@
var container = new Element("div");
Plumb.Output.output(Plumb.Recognition.recognize(), container);
- var html = "";
-
function outputChildren(element, level) {
+ var html = "";
+
if (Object.isUndefined(level))
level = 0;
element.immediateDescendants().each(function(child) {
html += "  ".times(level) + "<div class="" + child.className + "">\n";
- if (child.hasClassName("column"))
- html += "  ".times(level + 1) + "Lorem ipsum dolor\n";
+ if (child.immediateDescendants().any())
+ html += outputChildren(child, level + 1);
else
- outputChildren(child, level + 1);
+ html += "  ".times(level + 1) + "Lorem ipsum dolor\n";
html += "  ".times(level) + "</div>\n";
});
+
+ return html;
}
-
- outputChildren(container);
-
- $("html").down("pre code").update(html);
+
+ $("html").down("pre code").update(outputChildren(container));
} catch (e) {
if (e == Plumb.UnsupportedLayout) {

0 comments on commit c6c6dc7

Please sign in to comment.