You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by zh...@apache.org on 2018/06/07 04:09:58 UTC

[incubator-mxnet] branch master updated: [MXNET-501] Navbar community fix (#11105)

This is an automated email from the ASF dual-hosted git repository.

zhasheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git


The following commit(s) were added to refs/heads/master by this push:
     new 2e10857  [MXNET-501] Navbar community fix (#11105)
2e10857 is described below

commit 2e108571ac431104b31c602be0c57443562b9441
Author: kpmurali <37...@users.noreply.github.com>
AuthorDate: Wed Jun 6 21:09:45 2018 -0700

    [MXNET-501] Navbar community fix (#11105)
    
    * Fixing the dropdown for community in the navbar
    
    * Initial hacky fix to the community drop down issue
    
    * Fixing the burger menu drop-down issue for mobile
    
    * Final fix to the burger dropdowns issue
---
 docs/_static/js/navbar.js            |  9 ++++++++-
 docs/_static/js/options.js           |  3 +++
 docs/_static/mxnet-theme/navbar.html | 11 ++++++-----
 3 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/docs/_static/js/navbar.js b/docs/_static/js/navbar.js
index 2719172..2a27c50 100644
--- a/docs/_static/js/navbar.js
+++ b/docs/_static/js/navbar.js
@@ -1,13 +1,17 @@
 var searchBox = $("#search-input-wrap");
 var TITLE = ['/install/', '/gluon/', '/api/', '/docs/', '/community/' ];
 var DOC_TITLE = ['/faq/', '/tutorials/', '/architecture/', '/model_zoo/'];
-var APISubmenu, versionSubmenu, docSubmenu;
+var APISubmenu, versionSubmenu, docSubmenu, communitySubmenu;
 $("#burgerMenu").children().each(function () {
     if($(this).children().first().html() == 'API') APISubmenu = $(this).clone();
     if($(this).children().first().html().startsWith('Versions')) versionSubmenu = $(this).clone();
+    if($(this).children().first().html().startsWith('Community')) communitySubmenu = $(this).clone();
     if($(this).children().first().html() == 'Docs') docSubmenu= $(this).clone();
 });
 
+$('.burger-link').on('click', function(e) { e.stopPropagation() });
+$('.burger-link').on('touchstart', function(e) { e.stopPropagation() });
+
 function navbar() {
     var leftOffset = 40;
     var plusMenuList = [];
@@ -50,6 +54,9 @@ function navbar() {
         else if(plusMenuList[i].attr('id') == 'dropdown-menu-position-anchor-docs') {
             $("#plusMenu").append(docSubmenu);
         }
+        else if(plusMenuList[i].attr('id') == 'dropdown-menu-position-anchor-community') {
+            $("#plusMenu").append(communitySubmenu);
+        }
         else {
             $("#plusMenu").append("<li></li>");
             plusMenuList[i].removeClass("main-nav-link");
diff --git a/docs/_static/js/options.js b/docs/_static/js/options.js
index 77ef940..8fe74ee 100644
--- a/docs/_static/js/options.js
+++ b/docs/_static/js/options.js
@@ -1,3 +1,6 @@
+//$('.burger-link').on('click', function(e) { e.stopPropagation() });
+//$('.burger-link').on('touchstart', function(e) { e.stopPropagation() });
+
 $(document).ready(function () {
     function label(lbl) {
         return lbl.replace(/[ .]/g, '-').toLowerCase();
diff --git a/docs/_static/mxnet-theme/navbar.html b/docs/_static/mxnet-theme/navbar.html
index 8ea2f9f..05ec5c4 100644
--- a/docs/_static/mxnet-theme/navbar.html
+++ b/docs/_static/mxnet-theme/navbar.html
@@ -55,17 +55,18 @@
           <ul id="burgerMenu" class="dropdown-menu">
               <li><a href="{{url_root}}install/index.html">Install</a></li>
               <li><a class="main-nav-link" href="{{url_root}}tutorials/index.html">Tutorials</a></li>
-              <li class="dropdown-submenu">
-                <a href="#" tabindex="-1">Community</a>
+              <li class="dropdown-submenu dropdown">
+                <a href="#" tabindex="-1" aria-haspopup="true" role="button" class="dropdown-toggle burger-link" data-toggle="dropdown">Community</a>
                 <ul class="dropdown-menu">
-                  <li><a tabindex="-1"  href="{{url_root}}community/index.html">Community</a></li>
+                  <li><a tabindex="-1"  href="http://discuss.mxnet.io">Forum</a></li>
+                  <li><a tabindex="-1"  href="https://github.com/apache/incubator-mxnet">Github</a></li>
                   <li><a tabindex="-1"  href="{{url_root}}community/contribute.html">Contribute</a></li>
                   <li><a tabindex="-1"  href="{{url_root}}community/powered_by.html">Powered By</a></li>
                 </ul>
               </li>
               {% for name in ['API'] %}
               <li class="dropdown-submenu">
-                <a href="#" tabindex="-1">{{name}}</a>
+                <a href="#" tabindex="-1" role="button" aria-haspopup="true" class="dropdown-toggle burger-link" data-toggle="dropdown">{{name}}</a>
                 <ul class="dropdown-menu">
                   {% for lang in ['Python', 'Scala', 'R', 'Julia', 'C++', 'Perl'] %}
                     <li><a tabindex="-1" href="{{url_root}}{{name.lower()|replace(" ", "_")}}/{{lang.lower()}}/index.html">{{lang}}</a>
@@ -75,7 +76,7 @@
               </li>
               {% endfor %}
               <li class="dropdown-submenu">
-                <a href="#" tabindex="-1">Docs</a>
+                <a href="#" tabindex="-1" aria-haspopup="true" aria-expanded="true" class="dropdown-toggle burger-link" data-toggle="dropdown">Docs</a>
                 <ul class="dropdown-menu">
                   <li><a tabindex="-1"  href="{{url_root}}tutorials/index.html">Tutorials</a></li>
                   <li><a tabindex="-1"  href="{{url_root}}faq/index.html">FAQ</a></li>

-- 
To stop receiving notification emails like this one, please contact
zhasheng@apache.org.