Steps to reproduce:
- Enable totop option.
- Enable minimun elements.

The totop link is showed on content that dont have the minimun elements that TOC needs to be enabled.

CommentFileSizeAuthor
#13 3084718-13.patch1.38 KBlunitin
#3 3084718-3.patch1.4 KBflocondetoile
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

renguer0 created an issue. See original summary.

flocondetoile’s picture

Hello
Thanks for reporting. I will give a look soon.

flocondetoile’s picture

Status: Active » Needs review
FileSize
1.4 KB

This should fix the issue. Alse I reverse the logic "Hide the TOC if notenough elements visible".
Now the TOC is hidden by default, and is shown is there is enough elements visible in the TOC.

Thanks for your review

renguer0’s picture

Hi there, thanks for your answer.

I see that back-to-top with patch applied didn't shows nowhere, plus the title of TOC is showed when there isn't headings on articles.

renguer0’s picture

Status: Needs review » Needs work
flocondetoile’s picture

What is the TOC's title you are talking ? wouldn't that be by chance the title of the block? And no the TOC heading ?

renguer0’s picture

Status: Needs work » Fixed

Forget it. Clean installation of the module solved this issue, sorry for misinformation.

BTW I see that TOC is rendered (and hidded by css if conditionals not triggered). Maybe could be great if TOC only renders when conditionals occurs.

Thanks again for your time flocondetoile.

flocondetoile’s picture

Status: Fixed » Active

I believe that this issue is not yet fixed, until this patch is committed

renguer0’s picture

Status: Active » Reviewed & tested by the community
renguer0’s picture

Status: Reviewed & tested by the community » Needs work

I can confirm that it don't work, patch brokes some things that works in release without patchs.

flocondetoile’s picture

it break what ?
Have you some errors in your console ?

lunitin’s picture

This patch works for visibility, but there is a small logic bug. According to the Table of Contents settings, when the minimum selectors is set to 0 the table of contents will always be shown. However, the new conditional will only trigger show if minimum > 0.

lunitin’s picture

FileSize
1.38 KB
flocondetoile’s picture

Good catch @lunitin

renguer0’s picture

I've to apply the patch manually because "git apply PATCH" gives this:

error: patch failed: css/toc.css:1
error: css/toc.css: patch does not apply
warning: js/toc_js.js has type 100644, expected 100755
error: patch failed: less/toc.less:1
error: less/toc.less: patch does not apply

BTW I'll try the lastest modifications.

Thanks for your time.

  • lunitin authored 6f78bab on 8.x-1.x
    Issue #3084718 by flocondetoile, lunitin, renguer0: ToTop indicator...
flocondetoile’s picture

Status: Needs work » Fixed

Thanks everyone. committed.

Status: Fixed » Closed (fixed)

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