From a0c7b51d29c3afefc4f1f6affb301f7ca537953b Mon Sep 17 00:00:00 2001 From: Josh French Date: Wed, 29 Jun 2016 12:35:29 -0700 Subject: [PATCH] didRender is defined on the card regardless of editing context --- CARDS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CARDS.md b/CARDS.md index 5fab0768b..9c75ace4a 100644 --- a/CARDS.md +++ b/CARDS.md @@ -42,6 +42,7 @@ must be of the correct type (a DOM Node for the dom renderer, a string of html o * `isInEditor` [boolean] - true when the card is being rendered by an editor (not being rendered for display) * `name` [string] - the name of the card * `onTeardown` [function] - The card can pass a callback function: `onTeardown(callbackFn)`. The callback will be called when the rendered content is torn down. + * `didRender` [function] - The card can pass a callback function: `didRender(callbackFn)`. The callback will be called when the card is rendered (on initial render and also after transitioning between display/edit states). This callback can be used to do additional work that must happen after the card's element has been appended to the DOM. When being rendered by an editor (i.e., `env.isInEditor` is true), the env will have the following additional properties: @@ -52,7 +53,6 @@ When being rendered by an editor (i.e., `env.isInEditor` is true), the env will * `cancel` [function] - Called to transition from "edit" to "display" mode without changing the payload. It is a no-op if the card is in display mode already * `remove` [function] - Removes this card from the document * `postModel` [object] - The instance of this card's section in the editor's internal abstract tree. This can be used along with the mobiledoc-kit `postEditor` API to transform the card in other ways (for example, moving the card to a different section of the document) - * `didRender` [function] - The card can pass a callback function: `didRender(callbackFn)`. The callback will be called when the card is rendered (on initial render and also after transitioning between display/edit states). This callback can be used to do additional work that must happen after the card's element has been appended to the DOM. ## Card examples