projects
/
app.Builder.js
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
resources/RooUsage.txt
[app.Builder.js]
/
resources
/
roo.builder.js
diff --git
a/resources/roo.builder.js
b/resources/roo.builder.js
index
374c5ec
..
a53f114
100644
(file)
--- a/
resources/roo.builder.js
+++ b/
resources/roo.builder.js
@@
-78,15
+78,17
@@
Builder = {
if (tagName) {
var attr = [];
for(i = 0; i < currentElement.attributes.length;i++) {
if (tagName) {
var attr = [];
for(i = 0; i < currentElement.attributes.length;i++) {
- var aname = currentElement.attributes.item(i).name;
- if (aname=='id') {
+ var attre = currentElement.attributes.item(i);
+ var aname = attre.name;
+ var aval = attre.value || '';
+ if (aname=='id' && aval.match(/^roo\-/)) { // only roo -elements hide..
aname= 'xbuilderid';
}
aname= 'xbuilderid';
}
- // skip
- if (
currentElement.attributes.item(i).value == 'builderel') {
+ // skip
-- component created by the builder?
+ if (
aval == 'builderel') {
return;
}
return;
}
- attr.push(aname + '="' +
currentElement.attributes.item(i).value + '"' );
+ attr.push(aname + '="' +
aval + '"' ); //?? escaping attributes?
}
}
@@
-314,6
+316,9
@@
Builder = {
applyFlexy: function(tree)
{
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']);
if (typeof(tree['flexy:foreach']) != 'undefined') {
//Roo.log("add flexy:foreach");
tree.el.attr('flexy:foreach', tree['flexy:foreach']);
@@
-337,13
+342,22
@@
Builder = {
tree.el.attr('flexy:ignore', tree['flexy:ignore']);
}
tree.el.attr('flexy:ignore', tree['flexy:ignore']);
}
- //Roo.log("Add xtype")
tree.el.attr('xtype', tree['|xns'] + '.' + tree['xtype']);
tree.el.attr('xtype', tree['|xns'] + '.' + tree['xtype']);
- if (!tree.items || !tree.items.length) { return; }
//Roo.log(tree);
//Roo.log(tree);
- for (var i = 0; i < tree.items.length; i++){
- this.applyFlexy(tree.items[i]);
+ //Roo.log("Add xtype")
+
+
+
+ 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);
+ }
+
}
}