From 37a10bf3a660fe0ebed67ac24aa1bf4121974421 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Mon, 14 Jan 2019 16:19:00 +0800 Subject: [PATCH] Fix #5660 - roojs docs - linking and other tidy ups --- docs/Roo.docs.bjs | 23 ++++++++++++----- docs/Roo.docs.init.js | 47 ++++++++++++++++++++++++++++------ docs/Roo.docs.js | 53 ++++++++++++++++++++++++++------------- docs/Roo.docs.template.js | 10 ++++---- docs/docs.css | 19 ++++++++++++-- 5 files changed, 114 insertions(+), 38 deletions(-) diff --git a/docs/Roo.docs.bjs b/docs/Roo.docs.bjs index 9f518325be..267e870e6d 100644 --- a/docs/Roo.docs.bjs +++ b/docs/Roo.docs.bjs @@ -84,24 +84,33 @@ }, { "listeners" : { - "beforetoggle" : "function (_self)\n{\n _this.navGroup.autoExpand(); \n \n _this.navGroup.activeLookup();\n \n _this.navHeaderBar.mask.show();\n \n if(this.el.select('.navbar-collapse',true).first().hasClass('in')){\n _this.navHeaderBar.mask.hide();\n return;\n }\n}", - "render" : "function (_self)\n{\n return;\n \n _this.navHeaderBar = this;\n \n this.el.addClass(language); \n \n var body = Roo.select('body', true).first();\n \n var mark = {\n tag: \"div\",\n cls:\"x-dlg-mask\"\n };\n \n this.mask = Roo.DomHelper.append(body, mark, true);\n \n var size = body.getSize();\n this.mask.setSize(size.width, size.height);\n \n this.mask.setStyle('z-index', '1029');\n \n this.mask.enableDisplayMode(\"block\");\n this.mask.hide();\n \n this.mask.on('click', function(){\n \n this.el.select('.navbar-collapse',true).removeClass('in'); \n this.mask.hide();\n \n }, this);\n \n \n var maxHeight = Roo.lib.Dom.getViewHeight() - this.el.select('.navbar-header', true).first().getHeight();\n \n this.el.select('.navbar-collapse', true).first().setStyle('max-height', maxHeight);\n \n}" + "beforetoggle" : "function (_self)\n{\n // _this.mobileNavGroup.autoExpand(); \n \n \n if(!this.el.select('.navbar-collapse',true).first().hasClass('in')){\n this.el.select('.navbar-collapse',true).first().removeClass('in');\n return true;\n\n }\n if(!this.el.select('.navbar-collapse',true).first().hasClass('in')){\n // this.el.select('.navbar-collapse',true).first().setHeight(innerHeight-50);\n //(function() {\n // this.el.select('.navbar-collapse',true).first().setHeight(innerHeight-50);\n //}).defer(500,this);\n \n return;\n }\n}", + "render" : "function (_self)\n{\n \n _this.navHeaderBar = this;\n return;\n /*\n var body = Roo.select('body', true).first();\n \n var mark = {\n tag: \"div\",\n cls:\"x-dlg-mask\"\n };\n \n this.mask = Roo.DomHelper.append(body, mark, true);\n \n var size = body.getSize();\n this.mask.setSize(size.width, size.height);\n \n this.mask.setStyle('z-index', '1029');\n \n this.mask.enableDisplayMode(\"block\");\n this.mask.hide();\n \n this.mask.on('click', function(){\n \n this.el.select('.navbar-collapse',true).removeClass('in'); \n this.mask.hide();\n \n }, this);\n \n \n var maxHeight = Roo.lib.Dom.getViewHeight() - this.el.select('.navbar-header', true).first().getHeight();\n \n this.el.select('.navbar-collapse', true).first().setStyle('max-height', maxHeight);\n */\n}" }, - "$ String brand_href" : "baseURL + '/'", "String cls" : "mobile-header-menu", "String position" : "fixed-top", "bool autohide" : true, "xtype" : "NavHeaderbar", "Boolean inverse" : false, + "String brand_href" : "#", "$ xns" : "Roo.bootstrap", "String brand" : " ", - "String style" : "" + "String style" : "", + "items" : [ + { + "listeners" : { + "render" : "function (_self)\n{\n _this.mobileNavGroup = this;\n}" + }, + "xtype" : "NavGroup", + "$ xns" : "Roo.bootstrap" + } + ] }, { "listeners" : { "render" : "function (_self)\n{\n _this.introContainer = this;\n}" }, - "String cls" : "general-content-body", + "String cls" : "general-content-body general-content-intro", "xtype" : "Container", "$ xns" : "Roo.bootstrap", "items" : [ @@ -137,7 +146,6 @@ "Number md" : 9, "xtype" : "Column", "$ xns" : "Roo.bootstrap", - "String style" : "padding-left: 0px;", "items" : [ { "String cls" : "doc-header-container", @@ -284,6 +292,7 @@ "Number md" : 1, "$ Function renderer" : "function(v,x,r) { \n if (r.json.memberOf == Roo.docs.init.currentClass) {\n return '';\n }\n\n\t\treturn \t'' + r.json.memberOf + '';\n\t\t\t\n}", "xtype" : "ColumnModel", + "Number xs" : 0, "$ xns" : "Roo.grid", "* prop" : "cm[]" }, @@ -347,6 +356,7 @@ "String dataIndex" : "memberOf", "$ Function renderer" : "function(v,x,r) { \n\n if (r.json.memberOf == Roo.docs.init.currentClass) {\n return '';\n }\n\t\treturn \t'' + r.json.memberOf + '';\n\t\t\t\n}", "xtype" : "ColumnModel", + "Number xs" : 0, "$ xns" : "Roo.grid", "* prop" : "cm[]" }, @@ -410,6 +420,7 @@ "Number md" : 1, "$ Function renderer" : "function(v,x,r) { \n if (r.json.memberOf == Roo.docs.init.currentClass) {\n return '';\n }\n\n\t\treturn \t'' + r.json.memberOf + '';\n\t\t\t\n}", "xtype" : "ColumnModel", + "Number xs" : 0, "$ xns" : "Roo.grid", "* prop" : "cm[]" }, diff --git a/docs/Roo.docs.init.js b/docs/Roo.docs.init.js index dbf8fddd56..62ad99092d 100644 --- a/docs/Roo.docs.init.js +++ b/docs/Roo.docs.init.js @@ -3,7 +3,7 @@ Roo.docs.init = { classes : false, // flat version of list of classes - currentClass : '', // currently viewed class name + currentClass : '--none--', // currently viewed class name hash : '', @@ -54,16 +54,30 @@ Roo.docs.init = { // our classes witch children first.. d.forEach(function(e) { if (e.cn.length) { - this.addTreeItem(Roo.docs.navGroup, e, 'NavSidebarItem'); + this.addTreeItem(Roo.docs.navGroup, e, 'NavSidebarItem', true); } }, this); d.forEach(function(e) { if (!e.cn.length) { - this.addTreeItem(Roo.docs.navGroup, e, 'NavSidebarItem'); + this.addTreeItem(Roo.docs.navGroup, e, 'NavSidebarItem' ,true); } }, this); + + d.forEach(function(e) { + if (e.cn.length) { + this.addTreeItem(Roo.docs.mobileNavGroup, e, 'NavSidebarItem', false); + + } + }, this); + + d.forEach(function(e) { + if (!e.cn.length) { + this.addTreeItem(Roo.docs.mobileNavGroup, e, 'NavSidebarItem', false); + } + }, this); + var roo = Roo.docs.navGroup.items[1].menu; roo.show(roo.triggerEl, '?', false); if (location.hash.length) { @@ -149,9 +163,20 @@ Roo.docs.init = { }) })); - e.node = node; - e.parent_menu = parent; - e.parent = parent_e; + + // mobile nodes..? + + + + + + + if (parent_e !== false) { + e.node = node; + e.parent_menu = parent; + e.parent = parent_e == true ? null : parent_e; + } + parent.items.push(node); if (e.cn.length && type == 'NavSidebarItem') { this.topm = node.menu; @@ -165,14 +190,14 @@ Roo.docs.init = { var cn = ec.name.split('.').pop(); //Roo.log(cn); if (cn == cn.toLowerCase()) { - this.addTreeItem(node.menu, ec,'MenuItem', e); + this.addTreeItem(node.menu, ec,'MenuItem', parent_e !== false ? e : false); } }, this); e.cn.forEach(function(ec) { var cn = ec.name.split('.').pop(); if (cn != cn.toLowerCase()) { - this.addTreeItem(node.menu, ec,'MenuItem', e); + this.addTreeItem(node.menu, ec,'MenuItem', parent_e !== false ? e : false); } }, this); @@ -211,7 +236,13 @@ Roo.docs.init = { loadDoc : function(cls) { + if (this.currentClass == cls.name) { + return; + } + //Roo.docs.mobileNavGroup.hide(); + Roo.log("loadDoc?"); Roo.docs.doc_body_content.hide(); + this.currentClass = cls.name; if (!cls ) { Roo.docs.introBody.show(); diff --git a/docs/Roo.docs.js b/docs/Roo.docs.js index 6e6c2dd8b4..d9bbc06043 100644 --- a/docs/Roo.docs.js +++ b/docs/Roo.docs.js @@ -230,7 +230,7 @@ Roo.docs = new Roo.XComponent({ xtype : 'NavHeaderbar', autohide : true, brand : ' ', - brand_href : baseURL + '/', + brand_href : '#', cls : 'mobile-header-menu', inverse : false, position : 'fixed-top', @@ -238,25 +238,29 @@ Roo.docs = new Roo.XComponent({ listeners : { beforetoggle : function (_self) { - _this.navGroup.autoExpand(); + // _this.mobileNavGroup.autoExpand(); - _this.navGroup.activeLookup(); - - _this.navHeaderBar.mask.show(); - - if(this.el.select('.navbar-collapse',true).first().hasClass('in')){ - _this.navHeaderBar.mask.hide(); + + if(!this.el.select('.navbar-collapse',true).first().hasClass('in')){ + this.el.select('.navbar-collapse',true).first().removeClass('in'); + return true; + + } + if(!this.el.select('.navbar-collapse',true).first().hasClass('in')){ + // this.el.select('.navbar-collapse',true).first().setHeight(innerHeight-50); + //(function() { + // this.el.select('.navbar-collapse',true).first().setHeight(innerHeight-50); + //}).defer(500,this); + return; } }, render : function (_self) { + + _this.navHeaderBar = this; return; - - _this.navHeaderBar = this; - - this.el.addClass(language); - + /* var body = Roo.select('body', true).first(); var mark = { @@ -285,15 +289,28 @@ Roo.docs = new Roo.XComponent({ var maxHeight = Roo.lib.Dom.getViewHeight() - this.el.select('.navbar-header', true).first().getHeight(); this.el.select('.navbar-collapse', true).first().setStyle('max-height', maxHeight); - + */ } }, xns : Roo.bootstrap, - '|xns' : 'Roo.bootstrap' + '|xns' : 'Roo.bootstrap', + items : [ + { + xtype : 'NavGroup', + listeners : { + render : function (_self) + { + _this.mobileNavGroup = this; + } + }, + xns : Roo.bootstrap, + '|xns' : 'Roo.bootstrap' + } + ] }, { xtype : 'Container', - cls : 'general-content-body', + cls : 'general-content-body general-content-intro', listeners : { render : function (_self) { @@ -344,7 +361,6 @@ Roo.docs = new Roo.XComponent({ { xtype : 'Column', md : 9, - style : 'padding-left: 0px;', xns : Roo.bootstrap, '|xns' : 'Roo.bootstrap', items : [ @@ -585,6 +601,7 @@ Roo.docs = new Roo.XComponent({ return '' + r.json.memberOf + ''; }, + xs : 0, xns : Roo.grid, '|xns' : 'Roo.grid' } @@ -680,6 +697,7 @@ Roo.docs = new Roo.XComponent({ return '' + r.json.memberOf + ''; }, + xs : 0, xns : Roo.grid, '|xns' : 'Roo.grid' } @@ -772,6 +790,7 @@ Roo.docs = new Roo.XComponent({ return '' + r.json.memberOf + ''; }, + xs : 0, xns : Roo.grid, '|xns' : 'Roo.grid' } diff --git a/docs/Roo.docs.template.js b/docs/Roo.docs.template.js index 3b323399d1..2acba43289 100644 --- a/docs/Roo.docs.template.js +++ b/docs/Roo.docs.template.js @@ -155,10 +155,10 @@ Roo.docs.template = { if (member.returns.length) { output += ': '; for(var i = 0;i< member.returns.length;i++) { - var item = member.returns[i]; - output += (i > 0 ? ' or ' : '') + - this.linkSymbol(item.type); - } + var item = member.returns[i]; + output += (i > 0 ? ' or ' : '') + + this.linkSymbol(item.type); + } } @@ -360,7 +360,7 @@ Roo.docs.template = { if (!params.length) return "()"; var linkSymbol = this.linkSymbol; - var signature = "(" + + var signature = " (" + params.filter( function($) { return $.name.indexOf(".") == -1; // don't show config params in signature diff --git a/docs/docs.css b/docs/docs.css index 4325f4d97c..6ef293a174 100644 --- a/docs/docs.css +++ b/docs/docs.css @@ -471,9 +471,23 @@ header-menu-options ul.socials > li:first-child, display:inline-table; } @media (max-width: 768px) { - .general-content-body, - .slide-container { + .general-content-body > .container, + .general-content-body > .container > .column + { + margin: 0; + padding: 10px; + + } + .general-content-intro > .container, + .general-content-body > .container > .column + { + padding: 0; + } + .general-content-body > h1 + { margin: 10px; + margin-top: 50px; + } roo-select2-container .services .main-content { @@ -595,6 +609,7 @@ header-menu-options ul.socials > li:first-child, height: 34px; background-repeat: no-repeat; margin: 10px 10px 2px; + background-size: contain; } -- 2.39.2