Fix #5660 - roojs docs - linking and other tidy ups
authorAlan Knowles <alan@roojs.com>
Mon, 14 Jan 2019 08:19:00 +0000 (16:19 +0800)
committerAlan Knowles <alan@roojs.com>
Mon, 14 Jan 2019 08:19:00 +0000 (16:19 +0800)
docs/Roo.docs.bjs
docs/Roo.docs.init.js
docs/Roo.docs.js
docs/Roo.docs.template.js
docs/docs.css

index 9f51832..267e870 100644 (file)
     },
     {
      "listeners" : {
     },
     {
      "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 cls" : "mobile-header-menu",
      "String position" : "fixed-top",
      "bool autohide" : true,
      "xtype" : "NavHeaderbar",
      "Boolean inverse" : false,
+     "String brand_href" : "#",
      "$ xns" : "Roo.bootstrap",
      "String brand" : " ",
      "$ 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}"
      },
     },
     {
      "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" : [
      "xtype" : "Container",
      "$ xns" : "Roo.bootstrap",
      "items" : [
          "Number md" : 9,
          "xtype" : "Column",
          "$ xns" : "Roo.bootstrap",
          "Number md" : 9,
          "xtype" : "Column",
          "$ xns" : "Roo.bootstrap",
-         "String style" : "padding-left: 0px;",
          "items" : [
           {
            "String cls" : "doc-header-container",
          "items" : [
           {
            "String cls" : "doc-header-container",
            "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'<small><a href=\"#' + r.json.memberOf + '\">' + r.json.memberOf + '</a></small>';\n\t\t\t\n}",
            "xtype" : "ColumnModel",
            "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'<small><a href=\"#' + r.json.memberOf + '\">' + r.json.memberOf + '</a></small>';\n\t\t\t\n}",
            "xtype" : "ColumnModel",
+           "Number xs" : 0,
            "$ xns" : "Roo.grid",
            "* prop" : "cm[]"
           },
            "$ xns" : "Roo.grid",
            "* prop" : "cm[]"
           },
            "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'<small><a href=\"#' + r.json.memberOf + '\">' + r.json.memberOf + '</a></small>';\n\t\t\t\n}",
            "xtype" : "ColumnModel",
            "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'<small><a href=\"#' + r.json.memberOf + '\">' + r.json.memberOf + '</a></small>';\n\t\t\t\n}",
            "xtype" : "ColumnModel",
+           "Number xs" : 0,
            "$ xns" : "Roo.grid",
            "* prop" : "cm[]"
           },
            "$ xns" : "Roo.grid",
            "* prop" : "cm[]"
           },
            "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'<small><a href=\"#' + r.json.memberOf + '\">' + r.json.memberOf + '</a></small>';\n\t\t\t\n}",
            "xtype" : "ColumnModel",
            "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'<small><a href=\"#' + r.json.memberOf + '\">' + r.json.memberOf + '</a></small>';\n\t\t\t\n}",
            "xtype" : "ColumnModel",
+           "Number xs" : 0,
            "$ xns" : "Roo.grid",
            "* prop" : "cm[]"
           },
            "$ xns" : "Roo.grid",
            "* prop" : "cm[]"
           },
index dbf8fdd..62ad990 100644 (file)
@@ -3,7 +3,7 @@
 Roo.docs.init = {
     
     classes : false, // flat version of list of classes 
 Roo.docs.init = {
     
     classes : false, // flat version of list of classes 
-    currentClass : '', // currently viewed class name
+    currentClass : '--none--', // currently viewed class name
     
     hash : '',
     
     
     hash : '',
     
@@ -54,16 +54,30 @@ Roo.docs.init = {
                 // our classes witch children first..
                 d.forEach(function(e) {
                     if (e.cn.length) {
                 // 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);
                 
                 d.forEach(function(e) {
                     if (!e.cn.length) {
-                        this.addTreeItem(Roo.docs.navGroup, e, 'NavSidebarItem');
+                        this.addTreeItem(Roo.docs.navGroup, e, 'NavSidebarItem' ,true);
                     }
                 }, this);
                     }
                 }, 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) {
                 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;
         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()) {
             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);
         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);
         
             }
         }, this);
         
@@ -211,7 +236,13 @@ Roo.docs.init = {
     
     loadDoc : function(cls)
     {
     
     loadDoc : function(cls)
     {
+        if (this.currentClass == cls.name) {
+            return;
+        }
+        //Roo.docs.mobileNavGroup.hide();
+        Roo.log("loadDoc?");
         Roo.docs.doc_body_content.hide();
         Roo.docs.doc_body_content.hide();
+        
         this.currentClass = cls.name;
         if (!cls ) {
             Roo.docs.introBody.show();
         this.currentClass = cls.name;
         if (!cls ) {
             Roo.docs.introBody.show();
index 6e6c2dd..d9bbc06 100644 (file)
@@ -230,7 +230,7 @@ Roo.docs = new Roo.XComponent({
      xtype : 'NavHeaderbar',
      autohide : true,
      brand : ' ',
      xtype : 'NavHeaderbar',
      autohide : true,
      brand : ' ',
-     brand_href : baseURL + '/',
+     brand_href : '#',
      cls : 'mobile-header-menu',
      inverse : false,
      position : 'fixed-top',
      cls : 'mobile-header-menu',
      inverse : false,
      position : 'fixed-top',
@@ -238,25 +238,29 @@ Roo.docs = new Roo.XComponent({
      listeners : {
       beforetoggle : function (_self)
        {
      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)
        {
                return;
            }
        },
       render : function (_self)
        {
+          
+            _this.navHeaderBar = this;
            return;
            return;
-           
-           _this.navHeaderBar = this;
-           
-           this.el.addClass(language); 
-           
+           /*
            var body = Roo.select('body', true).first();
            
            var mark = {
            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);
            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'
+     '|xns' : 'Roo.bootstrap',
+     items  : [
+      {
+       xtype : 'NavGroup',
+       listeners : {
+        render : function (_self)
+         {
+             _this.mobileNavGroup = this;
+         }
+       },
+       xns : Roo.bootstrap,
+       '|xns' : 'Roo.bootstrap'
+      }
+     ]
     },
     {
      xtype : 'Container',
     },
     {
      xtype : 'Container',
-     cls : 'general-content-body',
+     cls : 'general-content-body general-content-intro',
      listeners : {
       render : function (_self)
        {
      listeners : {
       render : function (_self)
        {
@@ -344,7 +361,6 @@ Roo.docs = new Roo.XComponent({
         {
          xtype : 'Column',
          md : 9,
         {
          xtype : 'Column',
          md : 9,
-         style : 'padding-left: 0px;',
          xns : Roo.bootstrap,
          '|xns' : 'Roo.bootstrap',
          items  : [
          xns : Roo.bootstrap,
          '|xns' : 'Roo.bootstrap',
          items  : [
@@ -585,6 +601,7 @@ Roo.docs = new Roo.XComponent({
                        return  '<small><a href="#' + r.json.memberOf + '">' + r.json.memberOf + '</a></small>';
                                
            },
                        return  '<small><a href="#' + r.json.memberOf + '">' + r.json.memberOf + '</a></small>';
                                
            },
+           xs : 0,
            xns : Roo.grid,
            '|xns' : 'Roo.grid'
           }
            xns : Roo.grid,
            '|xns' : 'Roo.grid'
           }
@@ -680,6 +697,7 @@ Roo.docs = new Roo.XComponent({
                        return  '<small><a href="#' + r.json.memberOf + '">' + r.json.memberOf + '</a></small>';
                                
            },
                        return  '<small><a href="#' + r.json.memberOf + '">' + r.json.memberOf + '</a></small>';
                                
            },
+           xs : 0,
            xns : Roo.grid,
            '|xns' : 'Roo.grid'
           }
            xns : Roo.grid,
            '|xns' : 'Roo.grid'
           }
@@ -772,6 +790,7 @@ Roo.docs = new Roo.XComponent({
                        return  '<small><a href="#' + r.json.memberOf + '">' + r.json.memberOf + '</a></small>';
                                
            },
                        return  '<small><a href="#' + r.json.memberOf + '">' + r.json.memberOf + '</a></small>';
                                
            },
+           xs : 0,
            xns : Roo.grid,
            '|xns' : 'Roo.grid'
           }
            xns : Roo.grid,
            '|xns' : 'Roo.grid'
           }
index 3b32339..2acba43 100644 (file)
@@ -155,10 +155,10 @@ Roo.docs.template  = {
         if (member.returns.length) {
             output += ': ';
         for(var i = 0;i< member.returns.length;i++) {
         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;
         
             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
             params.filter(
                 function($) {
                     return $.name.indexOf(".") == -1; // don't show config params in signature
index 4325f4d..6ef293a 100644 (file)
@@ -471,9 +471,23 @@ header-menu-options ul.socials > li:first-child,
     display:inline-table;
 }
 @media (max-width: 768px) {
     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: 10px;
+        margin-top: 50px;
+       
     }
     roo-select2-container
     .services .main-content {
     }
     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;
     height: 34px;
     background-repeat: no-repeat;
     margin: 10px 10px 2px;
+        background-size: contain;
     
 }
  
     
 }