From 975c147036fb51b2d5bea308925c7703816ccbd0 Mon Sep 17 00:00:00 2001 From: Jordan Humphreys Date: Fri, 6 Mar 2020 13:47:44 -0800 Subject: [PATCH] Update docs. --- README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.md b/README.md index 7567022f..e5c03f5d 100644 --- a/README.md +++ b/README.md @@ -288,6 +288,26 @@ document }); ``` +### Active State Detection + +You can bind to the `tribute-active-true` or `tribute-active-false` events to detect when the menu is open or closed respectively. + +```js +document + .getElementById("myElement") + .addEventListener("tribute-active-true", function(e) { + console.log("Menu opened!"); + }); +``` + +```js +document + .getElementById("myElement") + .addEventListener("tribute-active-false", function(e) { + console.log("Menu closed!"); + }); +``` + ## Tips Some useful approaches to common roadblocks when implementing @mentions.