[
https://issues.apache.org/jira/browse/BEAM-13229?focusedWorklogId=773298&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-773298
]
ASF GitHub Bot logged work on BEAM-13229:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 23/May/22 06:15
Start Date: 23/May/22 06:15
Worklog Time Spent: 10m
Work Description: bullet03 commented on code in PR #17638:
URL: https://github.com/apache/beam/pull/17638#discussion_r879057657
##########
website/www/site/assets/js/language-switch-v2.js:
##########
@@ -89,7 +104,11 @@ $(document).ready(function() {
$("." + _self.wrapper + " ul li").click(function(el) {
// Making type preferences presistance, for user.
localStorage.setItem(_self.dbKey, $(this).data("type"));
+
+ // Set scroll to new position because Safari and Firefox
can't do it automatically, only Chrome under the good detects the correct
position of viewport
Review Comment:
done
##########
website/www/site/assets/js/language-switch-v2.js:
##########
@@ -10,11 +10,26 @@
// License for the specific language governing permissions and limitations
under
// the License.
+function getElPreviousPositionAndData(el) {
Review Comment:
done
##########
website/www/site/assets/js/language-switch-v2.js:
##########
@@ -10,11 +10,26 @@
// License for the specific language governing permissions and limitations
under
// the License.
+function getElPreviousPositionAndData(el) {
+ const clickedLangSwitchEl = el.target.closest(".language-switcher");
+ const elPreviousOffsetFromViewPort =
clickedLangSwitchEl.getBoundingClientRect().top;
+ return {
+ elPreviousOffsetFromViewPort,
+ clickedLangSwitchEl,
+ }
+}
+
+function setScrollToNewPosition(clickedElData) {
+ const { elPreviousOffsetFromViewPort, clickedLangSwitchEl } =
clickedElData;
+ const elCurrentHeight = window.pageYOffset +
clickedLangSwitchEl.getBoundingClientRect().top;
+ $('html, body').scrollTop(elCurrentHeight - elPreviousOffsetFromViewPort);
+}
+
$(document).ready(function() {
function Switcher(conf) {
var id = conf["class-prefix"],
- def = conf["default"],
- langs = [];
+ def = conf["default"],
Review Comment:
done
Issue Time Tracking
-------------------
Worklog Id: (was: 773298)
Time Spent: 5h (was: 4h 50m)
> [Website] Bug in side navigation when changing tabs in code snippets
> --------------------------------------------------------------------
>
> Key: BEAM-13229
> URL: https://issues.apache.org/jira/browse/BEAM-13229
> Project: Beam
> Issue Type: Bug
> Components: website
> Reporter: Mike Hernandez
> Assignee: Bulat Safiullin
> Priority: P2
> Labels: bug, website
> Time Spent: 5h
> Remaining Estimate: 0h
>
> Steps to reproduce the bug:
> # Go to the [Beam Programming
> Guide|https://beam.apache.org/documentation/programming-guide/] page
> # Go to any code snippet and click on its tabs
> # Notice at the right side in the side nav that the current pointer will be
> jumping around sections
> Other pages of Beam's documentation might have the same issue.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)