You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 1, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: app/docs/javascript.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,10 +11,10 @@ A number of components are available for you to use in your site:
11
11
12
12
Additionally, there are two utilities you can use to manipulate certain behavior outside of components using the `ContextUtil` plugin:
13
13
14
-
1. Focus Trapping: Use `ContextUtil.captureFocus(selector)` to trap focus within a given container. `selector` can be any valid class, id, attribute, or other identifier in the DOM. E.g., `.my-cool-class`. To release focus, use `ContextUtil.releaseFocus()`; it assumes you are releasing the focus on the same element you captured focus on, so don't call `captureFocus` twice in a row!
15
-
2. Focus Outline: Use `ContextUtil.enableFocusOutline()` to enable a focus outline when keyboard navigation activity is detected (spacebar, enter, escape, arrow keys, etc). Use `ContextUtil.disableFocusOutline()` to manually turn it off.
14
+
1.**Focus Trap**: Use `ContextUtil.captureFocus(selector)` to trap focus within a given container. `selector` can be any valid class, id, attribute, or other identifier in the DOM. E.g., `.my-cool-class`. To release focus, use `ContextUtil.releaseFocus()`; it assumes you are releasing focus on the same element you captured focus on, so don't call `captureFocus` twice in a row!
15
+
2.**Focus Outline**: Use `ContextUtil.enableFocusOutline()` to enable a focus outline when keyboard navigation activity is detected (tab, shift, spacebar, enter, escape, arrow keys, etc). Use `ContextUtil.disableFocusOutline()` to manually turn it off.
16
16
17
-
# API Patterns
17
+
##API Pattern
18
18
19
19
Undernet's components and focus outline plugin can all be enabled using a one line "start" method:
20
20
@@ -36,13 +36,13 @@ Modals.start()
36
36
Modals.stop()
37
37
```
38
38
39
-
## Bundling
39
+
## Bundle & Install Options
40
40
41
41
There's two main ways to gain access to the JavaScript: the CDN and NPM package. The API is the same in either case.
42
42
43
-
### CDN
43
+
### CDN or Static Assets
44
44
45
-
Just like in the [Introduction](/docs/overview/introduction) article, the fastest option is to add the compiled assets right to your layout. Then in a separate script tag, call the API.
45
+
Similar the [Introduction](/docs/overview/introduction) article (CDN example is used there), the fastest option is to add the compiled assets right to your layout. Then in a separate script tag, call the API.
0 commit comments