You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by pa...@apache.org on 2022/06/16 10:33:49 UTC

[shardingsphere] branch master updated: feat:fix optimize left menu usage (#18393)

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

panjuan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git


The following commit(s) were added to refs/heads/master by this push:
     new 1eb3d2deeb7 feat:fix optimize left menu usage (#18393)
1eb3d2deeb7 is described below

commit 1eb3d2deeb7ed1da28d9ae97cd4245a619f76247
Author: davidChan3000 <ch...@163.com>
AuthorDate: Thu Jun 16 18:33:35 2022 +0800

    feat:fix optimize left menu usage (#18393)
---
 docs/community/static/css/theme-white.css          | 21 +++++++++++++++++++++
 .../hugo-theme-learn/layouts/partials/menu.html    |  3 ++-
 .../themes/hugo-theme-learn/static/js/learn.js     |  8 ++++----
 docs/document/static/css/theme-white.css           | 22 +++++++++++++++++++++-
 .../hugo-theme-learn/layouts/partials/menu.html    |  4 +++-
 .../themes/hugo-theme-learn/static/js/learn.js     |  8 ++++----
 6 files changed, 55 insertions(+), 11 deletions(-)

diff --git a/docs/community/static/css/theme-white.css b/docs/community/static/css/theme-white.css
index fdab19f7ef3..5ddbdc2616b 100644
--- a/docs/community/static/css/theme-white.css
+++ b/docs/community/static/css/theme-white.css
@@ -64,6 +64,10 @@ header .select-style select{
     z-index: 2;
 }
 
+#sidebar .leftMenu{
+    overflow-y: auto;
+}
+
 #header-wrapper{
     position:sticky;
     background-color: #fff;
@@ -446,6 +450,7 @@ table td,table td code{
         left:-300px;
         width: 300px;
         padding-left: 16px;
+        background-color: #fff;
     }
 
     .sidebar-hidden #body{
@@ -462,6 +467,22 @@ table td,table td code{
         transform: translateX(0);
     }
     .icon-3,.icon-2,.icon-1{display: none;}
+
+    .retro-theme #sidebar{
+        background-color: #F2EFDD;
+    }
+    .eyehelp-theme #sidebar{
+        background-color: #C7EBC9;
+    }
+    .haitian-theme #sidebar{
+        background-color: #E5EDFF;
+    }
+    .deep-theme #sidebar{
+        background-color: #15202F;
+    }
+    .dark-theme #sidebar{
+        background-color: #171717;
+    }
 }
 
 @keyframes mymove {
diff --git a/docs/community/themes/hugo-theme-learn/layouts/partials/menu.html b/docs/community/themes/hugo-theme-learn/layouts/partials/menu.html
index 5a60d97e30e..f1ab1459715 100644
--- a/docs/community/themes/hugo-theme-learn/layouts/partials/menu.html
+++ b/docs/community/themes/hugo-theme-learn/layouts/partials/menu.html
@@ -12,6 +12,7 @@
     </div>
   
       <div class="highlightable">
+      <div class="leftMenu">
       <ul class="topics">
   
           {{if eq .Site.Params.ordersectionsby "title"}}  
@@ -38,7 +39,7 @@
           </ul>
         </section>
       {{end}}
-  
+    </div>
       <!-- {{ partial "language.html" . }} -->
   
       <!-- download button -->
diff --git a/docs/community/themes/hugo-theme-learn/static/js/learn.js b/docs/community/themes/hugo-theme-learn/static/js/learn.js
index 733b2a4addf..f62ecae8e84 100644
--- a/docs/community/themes/hugo-theme-learn/static/js/learn.js
+++ b/docs/community/themes/hugo-theme-learn/static/js/learn.js
@@ -26,8 +26,8 @@ function getScrollBarWidth() {
 };
 
 function setMenuHeight() {
-    $('#sidebar .highlightable').height($('#sidebar').innerHeight() - $('#header-wrapper').height() - 40);
-    $('#sidebar .highlightable').perfectScrollbar('update');
+    $('#sidebar .leftMenu').height($(window).innerHeight() - $('#header-wrapper').height() - 240);
+    $('#sidebar .leftMenu').perfectScrollbar('update');
 }
 
 function fallbackMessage(action) {
@@ -49,7 +49,7 @@ function fallbackMessage(action) {
 
 // for the window resize
 $(window).resize(function() {
-    // setMenuHeight();
+    setMenuHeight();
 });
 
 // debouncing function from John Hann
@@ -91,7 +91,7 @@ jQuery(document).ready(function() {
 
     var sidebarStatus = searchStatus = 'open';
     $('#sidebar .highlightable').perfectScrollbar();
-    // setMenuHeight();
+    setMenuHeight();
 
     jQuery('#overlay').on('click', function() {
         jQuery(document.body).toggleClass('sidebar-hidden');
diff --git a/docs/document/static/css/theme-white.css b/docs/document/static/css/theme-white.css
index d65e6193427..4889dacfabf 100644
--- a/docs/document/static/css/theme-white.css
+++ b/docs/document/static/css/theme-white.css
@@ -72,6 +72,10 @@ header .select-style select{
     z-index: 2;
 }
 
+#sidebar .leftMenu{
+    overflow-y: auto;
+}
+
 #header-wrapper{
     position:sticky;
     background-color: #fff;
@@ -465,6 +469,7 @@ table td,p,code{
         left:-300px;
         width: 300px;
         padding-left: 16px;
+        background-color: #fff;
     }
 
     .sidebar-hidden #body{
@@ -482,6 +487,21 @@ table td,p,code{
     }
     .icon-3,.icon-2,.icon-1{display: none;}
 
+    .retro-theme #sidebar{
+        background-color: #F2EFDD;
+    }
+    .eyehelp-theme #sidebar{
+        background-color: #C7EBC9;
+    }
+    .haitian-theme #sidebar{
+        background-color: #E5EDFF;
+    }
+    .deep-theme #sidebar{
+        background-color: #15202F;
+    }
+    .dark-theme #sidebar{
+        background-color: #171717;
+    }
 }
 
 @keyframes mymove {
@@ -548,7 +568,7 @@ table td,p,code{
 .retro-theme th{
     background-color: #F8F5EA;
 }
-.eyehelp-theme table,.retro-theme td,.retro-theme blockquote{
+.retro-theme table,.retro-theme td,.retro-theme blockquote{
     border-color: #dfdcdc;
 }
 /*eyehelp*/
diff --git a/docs/document/themes/hugo-theme-learn/layouts/partials/menu.html b/docs/document/themes/hugo-theme-learn/layouts/partials/menu.html
index 35270e77717..19f68aa1183 100644
--- a/docs/document/themes/hugo-theme-learn/layouts/partials/menu.html
+++ b/docs/document/themes/hugo-theme-learn/layouts/partials/menu.html
@@ -12,6 +12,7 @@
   </div>
 
     <div class="highlightable">
+    <div class="leftMenu">
     <ul class="topics">
 
         {{if eq .Site.Params.ordersectionsby "title"}}  
@@ -38,7 +39,8 @@
         </ul>
       </section>
     {{end}}
-
+    
+    </div>
     <!-- {{ partial "language.html" . }} -->
 
     <!-- download button -->
diff --git a/docs/document/themes/hugo-theme-learn/static/js/learn.js b/docs/document/themes/hugo-theme-learn/static/js/learn.js
index 733b2a4addf..f62ecae8e84 100644
--- a/docs/document/themes/hugo-theme-learn/static/js/learn.js
+++ b/docs/document/themes/hugo-theme-learn/static/js/learn.js
@@ -26,8 +26,8 @@ function getScrollBarWidth() {
 };
 
 function setMenuHeight() {
-    $('#sidebar .highlightable').height($('#sidebar').innerHeight() - $('#header-wrapper').height() - 40);
-    $('#sidebar .highlightable').perfectScrollbar('update');
+    $('#sidebar .leftMenu').height($(window).innerHeight() - $('#header-wrapper').height() - 240);
+    $('#sidebar .leftMenu').perfectScrollbar('update');
 }
 
 function fallbackMessage(action) {
@@ -49,7 +49,7 @@ function fallbackMessage(action) {
 
 // for the window resize
 $(window).resize(function() {
-    // setMenuHeight();
+    setMenuHeight();
 });
 
 // debouncing function from John Hann
@@ -91,7 +91,7 @@ jQuery(document).ready(function() {
 
     var sidebarStatus = searchStatus = 'open';
     $('#sidebar .highlightable').perfectScrollbar();
-    // setMenuHeight();
+    setMenuHeight();
 
     jQuery('#overlay').on('click', function() {
         jQuery(document.body).toggleClass('sidebar-hidden');