src/JsRender/NodeToJs.vala
[app.Builder.js] / src / JsRender / NodeToJs.vala
index ef4a931..6b8676f 100644 (file)
@@ -186,6 +186,8 @@ public class JsRender.NodeToJs : Object {
                        var v = this.out_props.get(k);
                        this.node.setLine(this.cur_line, "p",k); //listener
                        this.addLine(this.pad + k + " : " + v + suffix, ',');
+                       
+                       
                }
         
                // listeners..
@@ -223,7 +225,10 @@ public class JsRender.NodeToJs : Object {
                        var addstr = this.mungeChildNew(this.pad + indent_str, niter.get_value());
                        this.node.setLine(this.cur_line, "p",niter.get_key());
                        this.addLine(this.pad + niter.get_key() + " : " + addstr, ',');
-                       
+                       if (iter.get_key() == "xns") {
+                                       this.addLine(this.pad + "'|xns' : '" + addstr + "'", ',');
+
+                               }
                        
                }                        
                // prop arrays...
@@ -231,7 +236,7 @@ public class JsRender.NodeToJs : Object {
                var piter = this.out_props_array.map_iterator();
 
                while(piter.next()) {
-                       this.node.setLine(this.cur_line, "p", piter.get_key() );
+                       this.node.setLine(this.cur_line, "p",niter.get_key());
                        this.addLine(this.pad + piter.get_key() + " : [", 0);
                        
                        var pliter = piter.get_value().list_iterator();
@@ -276,7 +281,7 @@ public class JsRender.NodeToJs : Object {
        *
        */
 
-       char last_line_end = 0
+       char last_line_end = '!'
        
        /**
        * add a line - note we will end up with an extra line break 
@@ -289,7 +294,9 @@ public class JsRender.NodeToJs : Object {
        */
        public void addLine(string str, char line_end)
        {
-               this.ret += (this.last_line_end == 0 ? "" : this.last_line_end.to_string()) + "\n"; 
+               if (this.last_line_end != '!') {
+                       this.ret += (this.last_line_end == 0 ? "" : this.last_line_end.to_string()) + "\n"; 
+               }
                this.last_line_end = line_end;
                this.cur_line += str.split("\n").length;
                this.ret += str;
@@ -555,10 +562,7 @@ public class JsRender.NodeToJs : Object {
                                }
                                this.out_props.set(left, nstr);
                                
-                               if (left == "xns") {
-               
-                                       this.out_props.set("'|xns'", "'" +  nstr + "'" );
-                               }
+