From 3363db102653dcafb52da8e1049aed6db40888d7 Mon Sep 17 00:00:00 2001 From: Sean Doyle Date: Mon, 30 Sep 2024 12:40:14 -0400 Subject: [PATCH] Document the `trix-action-invoke` event The [Trix Wiki][wiki] has a page documenting how to [customize the Toolbar element][toolbar]. Its a helpful, thorough document with a lot of great information, including how to invoke custom actions through the rendering elements with an `x`-prefixed `[data-trix-action]` attribute. Since this information is at the bottom of the wiki page, it isn't readily available from the `README.md`. The `trix-action-invoke` event that's dispatched is also omitted from the README's list of events. This commit promotes the contents of the wiki page into the `README`, documents the `trix-action-invoke` event, and adds missing test coverage that exercises the event. [wiki]: https://github.com/basecamp/trix/wiki/Configuration [toolbar]: https://github.com/basecamp/trix/wiki/Configuration#toolbar --- README.md | 71 ++++++++++++++++++++++++++ src/test/system/custom_element_test.js | 24 +++++++++ 2 files changed, 95 insertions(+) diff --git a/README.md b/README.md index 0133f94a3..2645b79cd 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,75 @@ Place an empty `` tag on the page. Trix will automati Like an HTML `