Skip to content

Commit

Permalink
Adding @window (#676)
Browse files Browse the repository at this point in the history
Info is taken from #675 (comment)
  • Loading branch information
ThomasLandauer committed May 29, 2023
1 parent 9cc36fd commit f7953b6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion docs/reference/controllers.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,13 @@ class EffectsController extends Controller {
```

If the two controllers don't belong to the same HTML element, the `data-action` attribute
needs to be added to the *receiving* controller's element.
needs to be added to the *receiving* controller's element. And if the receiving controller's
element is not a parent (or same) of the emitting controller's element, you need to add
`@window` to the event:

```html
<div data-action="clipboard:copy@window->effects#flash">
```

`dispatch` accepts additional options as the second parameter as follows:

Expand Down

0 comments on commit f7953b6

Please sign in to comment.