traverseDOMTree : function(cb, currentElement, depth) {
- if (!currentElement) {
+ if (!currentElement || !currentElement.className) {
return;
}
}
if (nodeName != 'BODY') {
-
+ 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;