traverseDOMTree : function(cb, currentElement, depth) {
- if (!currentElement) {
+ if (!currentElement ) {
return;
}
//console.log(currentElement);
- if (currentElement.className.match(/roo-dynamic/)) {
+ if (currentElement.className && currentElement.className.match(/roo-dynamic/)) {
return;
}
return;
}
+ if (nodeName.match(/^#/)) { // comments?
+ return;
+ }
return;
}
if (nodeName != 'BODY') {
-
-
+ //Roo.log(currentElement);
+ if (currentElement.hasAttribute('flexy:include')) {
+
+
+ cb( '<flexy:include src="'+currentElement.getAttribute('flexy:include')+'"></flexy:include>');
+ return;
+ }
var i = 0;
// Prints the node tagName, such as <A>, <IMG>, etc
} else {
tagName = false;
}
- if (currentElement.hasAttribute('flexy:include')) {
- cb( tagName ? "</"+tagName+">" : '');
- }
+
// Traverse the tree
i = 0;
applyFlexy: function(tree)
{
+ if (!tree.el) {
+ return;
+ }
if (typeof(tree['flexy:foreach']) != 'undefined') {
//Roo.log("add flexy:foreach");
tree.el.attr('flexy:foreach', tree['flexy:foreach']);
//Roo.log("add flexy:if");
tree.el.attr('flexy:include', tree['flexy:include']);
}
- Roo.log("Add xtype")
+
+ if (typeof(tree['flexy:ignore']) != 'undefined') {
+ //Roo.log("add flexy:if");
+ tree.el.attr('flexy:ignore', tree['flexy:ignore']);
+ }
+
tree.el.attr('xtype', tree['|xns'] + '.' + tree['xtype']);
- if (!tree.items || !tree.items.length) { return; }
+ //Roo.log(tree);
+ //Roo.log("Add xtype")
- for (var i = 0; i < tree.items.length; i++){
- this.applyFlexy(tree.items[i]);
+
+
+ if (tree.items && tree.items.length > 0) {
+ //Roo.log(tree);
+ for (var i = 0; i < tree.items.length; i++){
+ this.applyFlexy(tree.items[i]);
+ }
}
+ if (typeof(tree.menu) == 'object') {
+ this.applyFlexy(tree.menu);
+ }
+
}