Roo/doc/Entry.js
[roojs1] / Roo / doc / Entry.js
1 /*
2  * - LGPL
3  *
4  *  Documentation - designed to generate HTML+Docbook!?!
5  */
6 Roo.doc = Roo.doc || {};
7
8 /**
9  * @class Roo.doc.Entry
10  * @extends Roo.bootstrap.Component
11  * Entry Element class - describes a method etc...
12  * @cfg name {String} name of method
13  * @cfg purpose {String} short description of method.
14  * 
15  * @constructor
16  * Create a new E
17  * @param {Object} config The config object
18  */
19
20
21
22 Roo.doc.Entry  = function(config){
23     Roo.doc.Entry.superclass.constructor.call(this, config);
24     //this.el = Roo.get(document.body);
25     var body = Roo.get(document.body);
26     body.attr({
27         leftmargin : 0,
28         marginwidth : 0,
29         topmargin : 0,
30         marginheight : 0,
31         offset : 0
32     });
33      
34     // call onRender once... and block next call...?
35     this.onRender(body);
36     //this.onRender = function() { };
37
38 };
39
40 Roo.doc.Entry._calls = 0;
41
42 Roo.extend(Roo.doc.Entry, Roo.bootstrap.Component,  {
43     
44     
45     name : '',
46     purpose : '',
47     
48     getAutoCreate : function(){
49         
50         var cfg ={
51             cls : 'refentry',
52             cn : [
53                 {
54                     tag: 'h1',
55                     cls: 'refname',
56                     html : this.name
57                 },
58                 {
59                     cls: 'refnamediv',
60                     html : this.purpose
61                 }
62             ]
63         };
64         
65         
66          
67         
68         return cfg;
69     },
70     
71     addxtype :   function (tree, cntr)
72     {
73         return this.addxtypeChild(tree,cntr);
74     },
75     
76     
77     onRender : function(ct, position)
78     {
79         
80         Roo.doc.Entry._calls++;
81         if (Roo.doc.Entry._calls > 1 || !ct) {
82             return;
83         }
84         
85     // call onRender once... and block next call...?
86     
87         Roo.bootstrap.Component.prototype.onRender.call(this, ct, position);
88     }
89    
90 });
91
92  
93
94