You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2020/04/05 12:55:01 UTC

[GitHub] [camel-website] aashnajena opened a new pull request #319: Fix redirecting to anchor tags

aashnajena opened a new pull request #319: Fix redirecting to anchor tags
URL: https://github.com/apache/camel-website/pull/319
 
 
   If we redirect to URLs with anchor tags, the upper portion gets hidden behind the header nav-bar.
   Example, try redirecting from https://camel.apache.org/blog/GSoC-2020-announced/ to one of the camel-projects https://camel.apache.org/projects/#apache-camel-k or https://camel.apache.org/projects/#apache-camel-extensions-for-quarkus. The heading is not visible.
   
   As far as my understanding goes, the fragment-jumper file aims at doing this task only. I'm not completely sure about what else the code in the file does, so I haven't deleted it, but the code snippet I have added will take care of all anchor redirections. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-website] aashnajena commented on issue #319: Fix redirecting to anchor tags

Posted by GitBox <gi...@apache.org>.
aashnajena commented on issue #319: Fix redirecting to anchor tags
URL: https://github.com/apache/camel-website/pull/319#issuecomment-609719898
 
 
   @zregvart thanks for sharing, I have made the required changes. The `--body-top` variable was not being used anywhere else, so I altered it to use here.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-website] zregvart merged pull request #319: Fix redirecting to anchor tags

Posted by GitBox <gi...@apache.org>.
zregvart merged pull request #319: Fix redirecting to anchor tags
URL: https://github.com/apache/camel-website/pull/319
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-website] Delawen commented on a change in pull request #319: Fix redirecting to anchor tags

Posted by GitBox <gi...@apache.org>.
Delawen commented on a change in pull request #319: Fix redirecting to anchor tags
URL: https://github.com/apache/camel-website/pull/319#discussion_r403876998
 
 

 ##########
 File path: antora-ui-camel/src/js/02-fragment-jumper.js
 ##########
 @@ -1,6 +1,10 @@
 ;(function () {
   'use strict'
 
+  var shiftWindow = function () { window.scrollBy(0, -80) }
+  if (window.location.hash) shiftWindow()
 
 Review comment:
   Nice trick :)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-website] Delawen commented on a change in pull request #319: Fix redirecting to anchor tags

Posted by GitBox <gi...@apache.org>.
Delawen commented on a change in pull request #319: Fix redirecting to anchor tags
URL: https://github.com/apache/camel-website/pull/319#discussion_r403877670
 
 

 ##########
 File path: antora-ui-camel/src/js/02-fragment-jumper.js
 ##########
 @@ -1,6 +1,10 @@
 ;(function () {
   'use strict'
 
+  var shiftWindow = function () { window.scrollBy(0, -80) }
 
 Review comment:
   These 80 pixels I understand they depend on the size of the bar. Is there no variable we can use here? Thinking on the future, when the bar size may change and this may not adjust properly anymore. I don't like having a long calculation each time this gets called, but it would be good to have some dependency on the height of the nav-bar.
   
   Also, add some comments on the source code explaining what and why this. In a couple of months we will not remember why this was here.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-website] zregvart commented on issue #319: Fix redirecting to anchor tags

Posted by GitBox <gi...@apache.org>.
zregvart commented on issue #319: Fix redirecting to anchor tags
URL: https://github.com/apache/camel-website/pull/319#issuecomment-609692951
 
 
   [Here is](https://css-tricks.com/fixed-headers-on-page-links-and-overlapping-content-oh-my/) one approach to solving this with CSS.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-website] aashnajena commented on issue #319: Fix redirecting to anchor tags

Posted by GitBox <gi...@apache.org>.
aashnajena commented on issue #319: Fix redirecting to anchor tags
URL: https://github.com/apache/camel-website/pull/319#issuecomment-609691724
 
 
   I hope the changes are better now!

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-website] aashnajena commented on a change in pull request #319: Fix redirecting to anchor tags

Posted by GitBox <gi...@apache.org>.
aashnajena commented on a change in pull request #319: Fix redirecting to anchor tags
URL: https://github.com/apache/camel-website/pull/319#discussion_r403956932
 
 

 ##########
 File path: antora-ui-camel/src/js/02-fragment-jumper.js
 ##########
 @@ -1,6 +1,10 @@
 ;(function () {
   'use strict'
 
+  var shiftWindow = function () { window.scrollBy(0, -80) }
 
 Review comment:
   Sure, makes sense. I'm thinking I can find the height of the navbar and add some buffer to it for scrolling. Shouldn't be a long calculation.
   
   Also, can you confirm if the rest of the code in the file is needed? I think it was meant to do this job, but I'm not sure if it serves any other purpose as well. Thanks!

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-website] zregvart commented on issue #319: Fix redirecting to anchor tags

Posted by GitBox <gi...@apache.org>.
zregvart commented on issue #319: Fix redirecting to anchor tags
URL: https://github.com/apache/camel-website/pull/319#issuecomment-609692014
 
 
   I think this problem should be solved without JavaScript, i.e. with CSS only.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [camel-website] zregvart commented on issue #319: Fix redirecting to anchor tags

Posted by GitBox <gi...@apache.org>.
zregvart commented on issue #319: Fix redirecting to anchor tags
URL: https://github.com/apache/camel-website/pull/319#issuecomment-610313567
 
 
   Thanks!

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services