roojs-core.js
[roojs1] / Roo / doc / Section.js
index ae015e9..82caba5 100644 (file)
@@ -26,7 +26,7 @@ Roo.extend(Roo.doc.Section, Roo.bootstrap.Component,  {
     getAutoCreate : function(){
         
         
-        
+        var syn = Roo.factory(this.parent().items[0]);
         
         var cfg ={
             
@@ -34,7 +34,7 @@ Roo.extend(Roo.doc.Section, Roo.bootstrap.Component,  {
             // id... ?
             cn : [
                 {
-                    tag: 'h1',
+                    tag: 'h3',
                     cls : 'title',
                     html : Roo.doc.Section.map[this.stype] 
                 }
@@ -48,17 +48,33 @@ Roo.extend(Roo.doc.Section, Roo.bootstrap.Component,  {
                 tag: 'ul',
                 cls: 'itemizedlist roo-params',
                 cn : []
-            }
+            };
             // might not have any..
-            var params = this.parent.items[0].items;
+            var params = syn.items;
             for (var i =0; i < params.length;i++) {
-                ul.cn.push( params[i].getAutoCreateParam() )
+                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;
     },
@@ -68,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;
     }
     
@@ -81,5 +98,6 @@ Roo.doc.Section.map = {
     'parameter' : 'Parameters',
     'return' : 'Return Value',
     'note' : 'Notes',
-    'example' : 'Examples'
+    'example' : 'Examples',
+    'throws' : 'Throws Exception'
 }