From 63eea1c9391f4ccb56be36b9c18a0479435cfbcd Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Fri, 9 Sep 2016 11:18:05 +0800 Subject: [PATCH] Roo/doc/Section.js roojs-doc.js roojs-doc-debug.js --- Roo/doc/Section.js | 2 +- roojs-doc-debug.js | 38 +++++++++++++++++++++++++++++++++++--- roojs-doc.js | 6 +++--- 3 files changed, 39 insertions(+), 7 deletions(-) diff --git a/Roo/doc/Section.js b/Roo/doc/Section.js index c6afd46b7c..bd48565d74 100644 --- a/Roo/doc/Section.js +++ b/Roo/doc/Section.js @@ -48,7 +48,7 @@ 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; for (var i =0; i < params.length;i++) { diff --git a/roojs-doc-debug.js b/roojs-doc-debug.js index 714718f9e9..a44bfc61cb 100644 --- a/roojs-doc-debug.js +++ b/roojs-doc-debug.js @@ -300,7 +300,29 @@ Roo.extend(Roo.doc.Param, Roo.bootstrap.Component, { return cfg; + }, + getAutoCreateParamSection : function() + { + return { + tag : 'li', + cn : [ + { + tag : 'p', + cls: 'para', + cn : [ + { + tag: 'code', + html : this.type + ' ' + this.name + }, + this.desc + ] + } + ] + }; + + } + @@ -356,10 +378,20 @@ Roo.extend(Roo.doc.Section, Roo.bootstrap.Component, { 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 = this.parent.items[0].items; + for (var i =0; i < params.length;i++) { + ul.cn.push( params[i].getAutoCreateParamSection() ) + } + + + cfg.cn.push(ul); } diff --git a/roojs-doc.js b/roojs-doc.js index 3405abb902..15aa445091 100644 --- a/roojs-doc.js +++ b/roojs-doc.js @@ -11,11 +11,11 @@ Roo.doc.Para=function(A){Roo.doc.Para.superclass.constructor.call(this,A);};Roo. // Roo/doc/Param.js Roo.doc.Param=function(A){Roo.doc.Param.superclass.constructor.call(this,A);};Roo.extend(Roo.doc.Param,Roo.bootstrap.Component,{is_optional:false,type:'',name:'',defaultvalue:'',desc:'',getAutoCreate:function(){if(this.parent().stype=='parameter'){return {tag:'li',cn:[{tag:'p',cls:'para',cn:[{tag:'code',html:this.type+' '+this.name} ,this.desc]}]};}if(this.parent().stype=='return'){return {tag:'p',cls:'para',cn:[{tag:'code',html:this.type},this.desc]};}var A={tag:'span',cn:[this.is_optional?'[':'',this.type,' ',{tag:'b',html:this.name},this.defaultvalue==''?'':' = ',this.defaultvalue,this.is_optional?']':'',',']} -;return A;}}); +;return A;},getAutoCreateParamSection:function(){return {tag:'li',cn:[{tag:'p',cls:'para',cn:[{tag:'code',html:this.type+' '+this.name},this.desc]}]};}}); // Roo/doc/Section.js Roo.doc.Section=function(A){Roo.doc.Section.superclass.constructor.call(this,A);};Roo.extend(Roo.doc.Section,Roo.bootstrap.Component,{stype:'',getAutoCreate:function(){var A={cls:'refsection',cn:[{tag:'h1',cls:'title',html:Roo.doc.Section.map[this.stype]}]} -;if(this.stype=='parameter'){A.cn.push({tag:'ul',cls:'itemizedlist roo-params'});}return A;},getChildContainer:function(A){if(this.stype=='parameter'){return this.el.select('.roo-params',true).first();}return this.el;}});Roo.doc.Section.map={'desc':'Description','parameter':'Parameters','return':'Return Value','note':'Notes','example':'Examples'}; - +;if(this.stype=='parameter'){var ul={tag:'ul',cls:'itemizedlist roo-params',cn:[]};var B=this.parent.items[0].items;for(var i=0;i