remove debugging code
[roojs1] / Roo / doc / Section.js
index 90267cb..82caba5 100644 (file)
@@ -25,27 +25,56 @@ Roo.extend(Roo.doc.Section, Roo.bootstrap.Component,  {
      
     getAutoCreate : function(){
         
+        
+        var syn = Roo.factory(this.parent().items[0]);
+        
         var cfg ={
             
             cls : 'refsection',
             // id... ?
             cn : [
                 {
-                    tag: 'h1',
+                    tag: 'h3',
                     cls : 'title',
-                    html : this.stype.charAt(0).toUpperCase() + this.stype.slice(1) //ucfirst
+                    html : Roo.doc.Section.map[this.stype] 
                 }
             ]
         };
         if (this.stype == 'parameter') {
             
             // db package uses variable list here... - it results in dd/dl but the layout is messed up..
-            cfg.cn.push({
+            
+            var ul = {
                 tag: 'ul',
-                cls: 'itemizedlist roo-params'
+                cls: 'itemizedlist roo-params',
+                cn : []
+            };
+            // might not have any..
+            var params = syn.items;
+            for (var i =0; i < params.length;i++) {
+                ul.cn.push( Roo.factory(params[i]).getAutoCreateParamSection() )
+            }
+            
+            
+            cfg.cn.push(ul);
+        }
+        if (this.stype == 'return' && (syn.returndesc.length || syn.returntype.length )) {
+            
+            cfg.cn.push({
+                tag: 'p',
+                cls : 'para',
+                cn : [
+                
+                    {
+                        tag: 'code',
+                        cls: 'parameter',
+                        html : syn.returntype
+                    },
+                    syn.returndesc
+                ]
+                
             });
         }
-        
        
         return cfg;
     },
@@ -55,6 +84,7 @@ Roo.extend(Roo.doc.Section, Roo.bootstrap.Component,  {
         if (this.stype == 'parameter') {
             return this.el.select('.roo-params',true).first();
         }
+       
         return this.el;
     }
     
@@ -63,5 +93,11 @@ Roo.extend(Roo.doc.Section, Roo.bootstrap.Component,  {
 });
 
  
-
\ No newline at end of file
+Roo.doc.Section.map = {
+    'desc' : 'Description',
+    'parameter' : 'Parameters',
+    'return' : 'Return Value',
+    'note' : 'Notes',
+    'example' : 'Examples',
+    'throws' : 'Throws Exception'
+}