The back to top link appears on first-page load, and only goes away when you start scrolling. I am working on a project where I need to hide the link on page load and it should only show when you scroll.

I created a small patch for the same attaching it here.

Comments

swarad07 created an issue. See original summary.

swarad07’s picture

Status: Active » Needs review
StatusFileSize
new2.71 KB

Also, fixes the coding standard issues in JS file.

sandipauti’s picture

Status: Needs review » Reviewed & tested by the community

@swarad07 - looks good for me. applied patch successfully.

w01f’s picture

Is it possible to tweak this a bit so that it would show on first-page load if the page isn't at the top. My use case is I have several pages that make use of anchors to automatically take the user down the page, and in these cases the back to top link should should instead of the user having to scroll down a bit in order to scroll back up.

swarad07’s picture

I believe that can be handled by just checking if URL has anchors and adding it as an acceptable case for showing back to top by default. But should be a separate issue IMO.

yogeshmpawar’s picture

+++ b/js/back_to_top.js
@@ -1,31 +1,40 @@
+      ¶

@swarad07 Can you remove this spaces, otherwise this patch looks good to me, +1 for RTBC.

yogeshmpawar’s picture

Assigned: swarad07 » yogeshmpawar

Assigning me to remove the unwanted spaces.

yogeshmpawar’s picture

Assigned: yogeshmpawar » Unassigned
StatusFileSize
new536 bytes
new2.91 KB

wrong patch added.

yogeshmpawar’s picture

StatusFileSize
new2.71 KB
new378 bytes

Updated patch with an interdiff, setting this issue back to "RTBC".
Removing earlier wrong patch.

  • acke committed 7dae14d on 8.x-1.x authored by yogeshmpawar
    Issue #2880660 by yogeshmpawar, swarad07: Triggers only after page...
acke’s picture

Status: Reviewed & tested by the community » Fixed

Included in 8.x-1.0. Thanks for your help!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.