You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by pa...@apache.org on 2022/04/29 06:15:56 UTC

[beam] branch master updated: Merge pull request #17260 from [BEAM-13229] [Website] bug side nav

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

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


The following commit(s) were added to refs/heads/master by this push:
     new c25c769c840 Merge pull request #17260 from [BEAM-13229] [Website] bug side nav
c25c769c840 is described below

commit c25c769c840784b576c0d7addac76eb23695d767
Author: bullet03 <bu...@akvelon.com>
AuthorDate: Fri Apr 29 12:15:49 2022 +0600

    Merge pull request #17260 from [BEAM-13229] [Website] bug side nav
    
    * [BEAM-13229] [Website] change offset to 1px
    
    * [BEAM-13229] [Website] change offset to 1px
    
    * [BEAM-13229] [Website] change offset to 10px
    
    * [BEAM-13229] [Website] add refresh to scrollspy
---
 website/www/site/assets/js/language-switch-v2.js          | 3 +++
 website/www/site/layouts/community/baseof.html            | 3 ++-
 website/www/site/layouts/contribute/arrow_template.html   | 3 ++-
 website/www/site/layouts/contribute/baseof.html           | 3 ++-
 website/www/site/layouts/documentation/baseof.html        | 3 ++-
 website/www/site/layouts/get-started/baseof.html          | 3 ++-
 website/www/site/layouts/languages/baseof.html            | 4 ++--
 website/www/site/layouts/roadmap/baseof.html              | 3 ++-
 website/www/site/layouts/runners/arrow_template.html      | 3 ++-
 website/www/site/layouts/runners/baseof.html              | 3 ++-
 website/www/site/layouts/runners/capability-template.html | 3 ++-
 website/www/site/layouts/security/baseof.html             | 3 ++-
 12 files changed, 25 insertions(+), 12 deletions(-)

diff --git a/website/www/site/assets/js/language-switch-v2.js b/website/www/site/assets/js/language-switch-v2.js
index a0ec6488c12..fc1decb9178 100644
--- a/website/www/site/assets/js/language-switch-v2.js
+++ b/website/www/site/assets/js/language-switch-v2.js
@@ -127,6 +127,9 @@ $(document).ready(function() {
                 // make sure that runner and shell snippets are still visible after changing language
                 $("code"+this.selector).show();
                 $("." + pref).show();
+
+                // Fix nav-menu bug with jumping between links when switching tabs
+                $('[data-spy="scroll"]').scrollspy('refresh');
             },
             "render": function(wrapper) {
                 this.addTabs();
diff --git a/website/www/site/layouts/community/baseof.html b/website/www/site/layouts/community/baseof.html
index f6b0664dd3d..26937c834ac 100644
--- a/website/www/site/layouts/community/baseof.html
+++ b/website/www/site/layouts/community/baseof.html
@@ -15,7 +15,8 @@
  <head>
    {{ partial "head.html" . }}
  </head>
- <body class="body" data-spy="scroll" data-target=".page-nav" data-offset="0">
+ <!--to activate an element via bootstrap's scrollspy library in the visible area, you need to scroll it by 10px relative to the browser window, so data-offset="10"-->
+ <body class="body" data-spy="scroll" data-target=".page-nav" data-offset="10">
    {{ partial "header.html" . }}
    <div class="clearfix container-main-content">
      <div class="section-nav closed" data-offset-top="90" data-offset-bottom="500">
diff --git a/website/www/site/layouts/contribute/arrow_template.html b/website/www/site/layouts/contribute/arrow_template.html
index 45b6431b872..2652b53884e 100644
--- a/website/www/site/layouts/contribute/arrow_template.html
+++ b/website/www/site/layouts/contribute/arrow_template.html
@@ -15,7 +15,8 @@
 <head>
   {{ partial "head.html" . }}
 </head>
-<body class="body" data-spy="scroll" data-target=".page-nav" data-offset="0">
+<!--to activate an element via bootstrap's scrollspy library in the visible area, you need to scroll it by 10px relative to the browser window, so data-offset="10"-->
+<body class="body" data-spy="scroll" data-target=".page-nav" data-offset="10">
   {{ partial "header.html" . }}
   <div class="clearfix container-main-content">
     <div class="section-nav closed" data-offset-top="90" data-offset-bottom="500">
diff --git a/website/www/site/layouts/contribute/baseof.html b/website/www/site/layouts/contribute/baseof.html
index b07f0ea7331..420c5996b80 100644
--- a/website/www/site/layouts/contribute/baseof.html
+++ b/website/www/site/layouts/contribute/baseof.html
@@ -15,7 +15,8 @@
 <head>
   {{ partial "head.html" . }}
 </head>
-<body class="body" data-spy="scroll" data-target=".page-nav" data-offset="0">
+<!--to activate an element via bootstrap's scrollspy library in the visible area, you need to scroll it by 10px relative to the browser window, so data-offset="10"-->
+<body class="body" data-spy="scroll" data-target=".page-nav" data-offset="10">
   {{ partial "header.html" . }}
   <div class="clearfix container-main-content">
     <div class="section-nav closed" data-offset-top="90" data-offset-bottom="500">
diff --git a/website/www/site/layouts/documentation/baseof.html b/website/www/site/layouts/documentation/baseof.html
index 9568c5fde3d..6621914e6f9 100644
--- a/website/www/site/layouts/documentation/baseof.html
+++ b/website/www/site/layouts/documentation/baseof.html
@@ -15,7 +15,8 @@
 <head>
   {{ partial "head.html" . }}
 </head>
-<body class="body" data-spy="scroll" data-target=".page-nav" data-offset="0">
+<!--to activate an element via bootstrap's scrollspy library in the visible area, you need to scroll it by 10px relative to the browser window, so data-offset="10"-->
+<body class="body" data-spy="scroll" data-target=".page-nav" data-offset="10">
   {{ partial "header.html" . }}
   <div class="clearfix container-main-content">
     <div class="section-nav closed" data-offset-top="90" data-offset-bottom="500">
diff --git a/website/www/site/layouts/get-started/baseof.html b/website/www/site/layouts/get-started/baseof.html
index 99025b37928..b8464b62684 100644
--- a/website/www/site/layouts/get-started/baseof.html
+++ b/website/www/site/layouts/get-started/baseof.html
@@ -15,7 +15,8 @@
 <head>
   {{ partial "head.html" . }}
 </head>
-<body class="body" data-spy="scroll" data-target=".page-nav" data-offset="0">
+<!--to activate an element via bootstrap's scrollspy library in the visible area, you need to scroll it by 10px relative to the browser window, so data-offset="10"-->
+<body class="body" data-spy="scroll" data-target=".page-nav" data-offset="10">
   {{ partial "header.html" . }}
   <div class="clearfix container-main-content">
     <div class="section-nav closed" data-offset-top="90" data-offset-bottom="500">
diff --git a/website/www/site/layouts/languages/baseof.html b/website/www/site/layouts/languages/baseof.html
index a7fe4a04c8f..65326519cb3 100644
--- a/website/www/site/layouts/languages/baseof.html
+++ b/website/www/site/layouts/languages/baseof.html
@@ -15,7 +15,8 @@
  <head>
    {{ partial "head.html" . }}
  </head>
- <body class="body" data-spy="scroll" data-target=".page-nav" data-offset="0">
+ <!--to activate an element via bootstrap's scrollspy library in the visible area, you need to scroll it by 10px relative to the browser window, so data-offset="10"-->
+ <body class="body" data-spy="scroll" data-target=".page-nav" data-offset="10">
    {{ partial "header.html" . }}
    <div class="clearfix container-main-content">
      <div class="section-nav closed" data-offset-top="90" data-offset-bottom="500">
@@ -38,4 +39,3 @@
  {{ partial "footer.html" . }}
  </body>
  </html>
- 
\ No newline at end of file
diff --git a/website/www/site/layouts/roadmap/baseof.html b/website/www/site/layouts/roadmap/baseof.html
index 3927bd11880..7a4e47ff507 100644
--- a/website/www/site/layouts/roadmap/baseof.html
+++ b/website/www/site/layouts/roadmap/baseof.html
@@ -15,7 +15,8 @@
 <head>
   {{ partial "head.html" . }}
 </head>
-<body class="body" data-spy="scroll" data-target=".page-nav" data-offset="0">
+<!--to activate an element via bootstrap's scrollspy library in the visible area, you need to scroll it by 10px relative to the browser window, so data-offset="10"-->
+<body class="body" data-spy="scroll" data-target=".page-nav" data-offset="10">
   {{ partial "header.html" . }}
   <div class="clearfix container-main-content">
     <div class="section-nav closed" data-offset-top="90" data-offset-bottom="500">
diff --git a/website/www/site/layouts/runners/arrow_template.html b/website/www/site/layouts/runners/arrow_template.html
index 1396a71863a..541589d4762 100644
--- a/website/www/site/layouts/runners/arrow_template.html
+++ b/website/www/site/layouts/runners/arrow_template.html
@@ -15,7 +15,8 @@
 <head>
   {{ partial "head.html" . }}
 </head>
-<body class="body" data-spy="scroll" data-target=".page-nav" data-offset="0">
+<!--to activate an element via bootstrap's scrollspy library in the visible area, you need to scroll it by 10px relative to the browser window, so data-offset="10"-->
+<body class="body" data-spy="scroll" data-target=".page-nav" data-offset="10">
   {{ partial "header.html" . }}
   <div class="clearfix container-main-content">
     <div class="section-nav closed" data-offset-top="90" data-offset-bottom="500">
diff --git a/website/www/site/layouts/runners/baseof.html b/website/www/site/layouts/runners/baseof.html
index 9ca7ead7443..b745cc61e17 100644
--- a/website/www/site/layouts/runners/baseof.html
+++ b/website/www/site/layouts/runners/baseof.html
@@ -15,7 +15,8 @@
 <head>
   {{ partial "head.html" . }}
 </head>
-<body class="body" data-spy="scroll" data-target=".page-nav" data-offset="0">
+<!--to activate an element via bootstrap's scrollspy library in the visible area, you need to scroll it by 10px relative to the browser window, so data-offset="10"-->
+<body class="body" data-spy="scroll" data-target=".page-nav" data-offset="10">
   {{ partial "header.html" . }}
   <div class="clearfix container-main-content">
     <div class="section-nav closed" data-offset-top="90" data-offset-bottom="500">
diff --git a/website/www/site/layouts/runners/capability-template.html b/website/www/site/layouts/runners/capability-template.html
index 3efcf39129f..3ee2daad4ed 100644
--- a/website/www/site/layouts/runners/capability-template.html
+++ b/website/www/site/layouts/runners/capability-template.html
@@ -15,7 +15,8 @@
 <head>
   {{ partial "head.html" . }}
 </head>
-<body class="body" data-spy="scroll" data-target=".page-nav" data-offset="0">
+<!--to activate an element via bootstrap's scrollspy library in the visible area, you need to scroll it by 10px relative to the browser window, so data-offset="10"-->
+<body class="body" data-spy="scroll" data-target=".page-nav" data-offset="10">
   {{ partial "header.html" . }}
   <div class="clearfix container-main-content">
     {{ .Content }}
diff --git a/website/www/site/layouts/security/baseof.html b/website/www/site/layouts/security/baseof.html
index b6d2c5253e1..482a85404e2 100644
--- a/website/www/site/layouts/security/baseof.html
+++ b/website/www/site/layouts/security/baseof.html
@@ -15,7 +15,8 @@
  <head>
    {{ partial "head.html" . }}
  </head>
- <body class="body" data-spy="scroll" data-target=".page-nav" data-offset="0">
+ <!--to activate an element via bootstrap's scrollspy library in the visible area, you need to scroll it by 10px relative to the browser window, so data-offset="10"-->
+ <body class="body" data-spy="scroll" data-target=".page-nav" data-offset="10">
    {{ partial "header.html" . }}
    <div class="clearfix container-main-content">
      <div class="section-nav closed" data-offset-top="90" data-offset-bottom="500">