You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by ov...@apache.org on 2021/04/22 10:03:09 UTC

[echarts-handbook] 03/03: update scroll-into-view type and style

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

ovilia pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/echarts-handbook.git

commit 02dce66e40ae8e4cef0dcade91ffe9fe2bd49547
Author: Ovilia <zw...@gmail.com>
AuthorDate: Thu Apr 22 18:02:41 2021 +0800

    update scroll-into-view type and style
---
 components/partials/Sidebar.vue | 17 +++++++----------
 layouts/default.vue             |  1 +
 package-lock.json               |  6 ++++++
 package.json                    |  1 +
 4 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/components/partials/Sidebar.vue b/components/partials/Sidebar.vue
index 8f9763a..8f0e3e4 100644
--- a/components/partials/Sidebar.vue
+++ b/components/partials/Sidebar.vue
@@ -1,5 +1,5 @@
 <template>
-  <div class="bd-sidebar border-bottom-0 col-sm-2 col-12">
+  <div class="bd-sidebar border-bottom-0 col-sm-3 col-sm-9 col-md-2 col-md-10">
     <!-- active: {{ active }}. {{ posts }} -->
     <div class="bd-docs-nav">
       <div class="bd-toc-item level0"
@@ -44,7 +44,7 @@ export default Vue.extend({
   mounted() {
 
     setTimeout(() => {
-      const $actived = this.$el.querySelector('.actived');
+      const $actived = this.$el.querySelector('.actived') as HTMLElement;
       if ($actived) {
         scrollIntoView($actived, {
           time: 200,
@@ -52,10 +52,9 @@ export default Vue.extend({
             top: 0,
             topOffset: 300
           },
-          isScrollable: function(target, defaultIsScrollable){
-            return target.className && target.className.indexOf('bd-sidebar') >= 0;
+          isScrollable: function(target){
+            return !!target.className && target.className.indexOf('bd-sidebar') >= 0;
           }
-
         });
       }
     }, 0);
@@ -76,7 +75,7 @@ export default Vue.extend({
 }
 
   .bd-toc-item {
-    margin-bottom: 20px;
+    margin-bottom: 10px;
   }
 
     .bd-sidenav {
@@ -147,9 +146,10 @@ export default Vue.extend({
 
         .level1 {
           margin-top: 4px;
+          font-size: 14px;
 
           .nav-link {
-            padding: 10px 0;
+            padding: 5px 0;
             color: #707070;
 
             &:hover {
@@ -181,9 +181,6 @@ export default Vue.extend({
             display: list-item;
             list-style: disc;
           }
-
-        .level1, .level2 {
-          margin-top: 0;
         }
 
         .level1 .nav-link {
diff --git a/layouts/default.vue b/layouts/default.vue
index c8abfde..12b87cf 100644
--- a/layouts/default.vue
+++ b/layouts/default.vue
@@ -65,6 +65,7 @@ export default {
   border-left: 1px solid #e3e3e3;
   padding: 10px;
   color: #888;
+  background-color: #fff;
   height: auto;
 
   @media (max-width: 768px) {
diff --git a/package-lock.json b/package-lock.json
index 3dcafe2..cd66136 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1808,6 +1808,12 @@
       "integrity": "sha1-a9p9uGU/piZD9e5p6facEaOS46Y=",
       "dev": true
     },
+    "@types/scroll-into-view": {
+      "version": "1.13.0",
+      "resolved": "https://registry.nlark.com/@types/scroll-into-view/download/@types/scroll-into-view-1.13.0.tgz",
+      "integrity": "sha1-c5AaxgtzOW11VHvbfwLNTrL6Kz0=",
+      "dev": true
+    },
     "@types/serve-static": {
       "version": "1.13.3",
       "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.3.tgz",
diff --git a/package.json b/package.json
index f3c0cba..4074278 100644
--- a/package.json
+++ b/package.json
@@ -25,6 +25,7 @@
     "@nuxt/typescript-build": "^0.6.0",
     "@nuxtjs/eslint-config-typescript": "^1.0.0",
     "@nuxtjs/eslint-module": "^1.0.0",
+    "@types/scroll-into-view": "^1.13.0",
     "babel-eslint": "^10.0.1",
     "child_process": "^1.0.2",
     "eslint": "^6.1.0",

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org