Closed (fixed)
Project:
Scroll progress
Version:
8.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
7 Jun 2019 at 06:51 UTC
Updated:
16 Feb 2023 at 06:30 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
basvredelingIf the js library is implemented within a block instead of a preprocess_html hook, you get all that stuff out of the box: display for specific users roles, node types or paths.
----
I've tried this approach but it doesn't function properly. So I've ended up hacking something into the theme instead.
Comment #3
flocondetoileThis patch add 2 new settings.
- Enable : this option allows the site builder to enable / disable the scroll progress globally. Without this option if a site builder want to disable the feature he must uninstall the module.
- Visibility conditions on the request path : you can configure the visibility based on the request path as does the condition plugin "request_path" with the possibility to negate the conditions. This settings should cover most needs.
The patch add a service helper which could permit to easily add others conditions in future if needed.
This capture show the new settings added.
An update hook set default value to the new settings : TRUE for enable and an empty array for visibility settings, to keep current behavior.
Comment #4
flocondetoilePatch #3 applies on 8.x-2.1. Looks like I need to reroll on 1.x-dev as the last commit changes the configuration name of the module settings (scroll_progress_config.settings became scroll_progress.settings). First waiting feedback from the maintainer.
Comment #5
flocondetoilePath #3 uses the path_alias manager service introduced in Drupal Core 8.8 (https://www.drupal.org/node/3092086). So it needs to require Drupal Core ^8.8 minimum version. I will update the patch with #4 feedbacks.
Comment #6
flocondetoilePatch #3 rerolled against 2.x-dev branch.
This patch add also another settings "Element" : The element on which we want to attach the scroll progress element. Default to body. This can be useful if for example you have a main navigation sticky and you want append the scroll progress inside this main navigation (and then in your theme you can chnage the css rule position of the scroll progress element).
This patch contains too the fix of the bug mentionned in #3205142: Markup bar-long or scroll-progress-bottom added multiple times.
Also several fix are included about :
- the missing dependency on drupalSettings for each library
- the missing config schema of the module settings
- a missing default config when the module is enabled
As the Service Helper uses the path_alias manager service introduced in Drupal Core 8.8, the minimum requirement for the module is ^8.8. The patch makes also the module compatible with Drupal 9, using
core_version_requirement: ^8.8 || ^9.Comment #8
flocondetoileOpened a merge request, to be able to package the module on a Drupal 9 project.
Comment #11
keshavv commentedComment #12
keshavv commentedComment #13
keshavv commented