Skip to content

Commit efc5826

Browse files
committed
fix(pat navigation): Change default scroll-trigger-selector to "a[href^='#'].scroll-trigger".
In the alpha.3 release it was "a[href^='#'].scroll-marker" where it should have been "a[href^='#'].scroll-trigger". This is fixed now.
1 parent a85b9f5 commit efc5826

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/pat/navigation/documentation.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ This would invoke a `click` event on the current navigation item and that can be
2626
The navigation pattern can be configured through a `data-pat-navigation` attribute.
2727
The available options are:
2828

29-
| Field | Default | Options | Description |
30-
| ----------------------- | ---------------------------- | ---------------------------------------- | ----------------------- |
31-
| item-wrapper | `li` | CSS selector | The DOM element which wraps each menu item. This is used to set the "current" and "in-path" classes also on the wrapper element. If empty, no wrapper element is used. |
32-
| in-path-class | `navigation-in-path` | CSS class name | Class name, which is set on item-wrapper elements if nested menu items are within the current path. |
33-
| current-class | `current` | CSS class name | Class name, which is set on item-wrapper or items if they are the currently selected menu option or - for hash links - when it's corresponding content item is in view. |
34-
| current-content-class | `current` | CSS class name | CSS class for a content item when it is the current one. |
35-
| in-view-class | `in-view` | CSS class name | CSS class for a navigation item when it's corresponding content item is in view. |
36-
| scrill-item-side | `top` | `top`, `bottom`, `middle`, `auto` | Side of element that scrolls. This is used to calculate the current item. The defined side of the element will be used to calculate the distance baseline. If this is set to "auto" then one of the "top" or "bottom" positions are used, depending on which one is nearer to the distance baseline. |
37-
| scrill-item-distance | `50%` | CSS length (px, %, vw, vh, vmin or vmax) | Distance from side of scroll box. any amount in px, %, vw, vh, vmin or vmax. This is used to calculate the current item. The nearest element to the distance-baseline measured from the top of the container will get the current class. |
38-
| scrill-item-visibility | | `none`, `most-visible` | Visibility of element in scroll box. This is used to calculate the current item. If "most-visible" is set, the element which is most visible in the scroll container gets the current class. If more elements have the same visibility ratio, the other conditions are used to calculate the current one. |
29+
| Field | Default | Options | Description |
30+
| ----------------------- | ----------------------------- | ---------------------------------------- | ----------------------- |
31+
| item-wrapper | `li` | CSS selector | The DOM element which wraps each menu item. This is used to set the "current" and "in-path" classes also on the wrapper element. If empty, no wrapper element is used. |
32+
| in-path-class | `navigation-in-path` | CSS class name | Class name, which is set on item-wrapper elements if nested menu items are within the current path. |
33+
| current-class | `current` | CSS class name | Class name, which is set on item-wrapper or items if they are the currently selected menu option or - for hash links - when it's corresponding content item is in view. |
34+
| current-content-class | `current` | CSS class name | CSS class for a content item when it is the current one. |
35+
| in-view-class | `in-view` | CSS class name | CSS class for a navigation item when it's corresponding content item is in view. |
36+
| scrill-item-side | `top` | `top`, `bottom`, `middle`, `auto` | Side of element that scrolls. This is used to calculate the current item. The defined side of the element will be used to calculate the distance baseline. If this is set to "auto" then one of the "top" or "bottom" positions are used, depending on which one is nearer to the distance baseline. |
37+
| scrill-item-distance | `50%` | CSS length (px, %, vw, vh, vmin or vmax) | Distance from side of scroll box. any amount in px, %, vw, vh, vmin or vmax. This is used to calculate the current item. The nearest element to the distance-baseline measured from the top of the container will get the current class. |
38+
| scrill-item-visibility | | `none`, `most-visible` | Visibility of element in scroll box. This is used to calculate the current item. If "most-visible" is set, the element which is most visible in the scroll container gets the current class. If more elements have the same visibility ratio, the other conditions are used to calculate the current one. |
3939
| scroll-trigger-selector | `a[href^='#'].scroll-trigger` | CSS selector, `none` | Selects the element within the pat-navigation container that should get a class current while scrolling, when applicable. |
4040

src/pat/navigation/navigation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ parser.addArgument("current-content-class", "navigation-current");
2020
parser.addArgument("scroll-item-side", "top", ["top", "bottom", "middle", "auto"]);
2121
parser.addArgument("scroll-item-distance", "50%");
2222
parser.addArgument("scroll-item-visibility", null, [null, "none", "most-visible"]);
23-
parser.addArgument("scroll-trigger-selector", "a[href^='#'].scroll-marker");
23+
parser.addArgument("scroll-trigger-selector", "a[href^='#'].scroll-trigger");
2424

2525
class Pattern extends BasePattern {
2626
static name = "navigation";

0 commit comments

Comments
 (0)