90267cbd847a51e0642bbcb94a90f9b8c0250f98
[roojs1] / Roo / doc / Section.js
1 /*
2  * - LGPL
3  *
4  */
5
6 /**
7  * @class Roo.doc.Section
8  * @extends Roo.bootstrap.Component
9  * SectionElement class
10  * @cfg {String} stype (desc|parameter|return|note|example) section type.
11  * 
12  * @constructor
13  * Create a new Synopsis
14  * @param {Object} config The config object
15  */
16
17 Roo.doc.Section = function(config){
18     Roo.doc.Section.superclass.constructor.call(this, config);
19 };
20
21 Roo.extend(Roo.doc.Section, Roo.bootstrap.Component,  {
22     
23     
24     stype:   '',
25      
26     getAutoCreate : function(){
27         
28         var cfg ={
29             
30             cls : 'refsection',
31             // id... ?
32             cn : [
33                 {
34                     tag: 'h1',
35                     cls : 'title',
36                     html : this.stype.charAt(0).toUpperCase() + this.stype.slice(1) //ucfirst
37                 }
38             ]
39         };
40         if (this.stype == 'parameter') {
41             
42             // db package uses variable list here... - it results in dd/dl but the layout is messed up..
43             cfg.cn.push({
44                 tag: 'ul',
45                 cls: 'itemizedlist roo-params'
46             });
47         }
48         
49         
50         return cfg;
51     },
52     getChildContainer : function(build_call)
53     {
54          
55         if (this.stype == 'parameter') {
56             return this.el.select('.roo-params',true).first();
57         }
58         return this.el;
59     }
60     
61     
62    
63 });
64
65  
66
67