From 939d1ec83ad9e3de336a4e788672eb045ba11f6a Mon Sep 17 00:00:00 2001 From: MattMo Date: Mon, 18 Mar 2024 09:33:16 -0700 Subject: [PATCH] Added a new after render function for elements. --- ignite-element.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ignite-element.js b/ignite-element.js index acae117..2eaf686 100644 --- a/ignite-element.js +++ b/ignite-element.js @@ -295,6 +295,11 @@ class IgniteElement extends HTMLElement { //Leave the rendering context. IgniteRendering.leave(); + //Invoke the after render function, ensure we are not in a rendering context. + IgniteRendering.push(); + this.afterRender(); + IgniteRendering.pop(); + //Let the rendering context know this element is ready. IgniteRendering.ready(this.readyCallback); } @@ -372,6 +377,14 @@ class IgniteElement extends HTMLElement { return null; } + /** + * Called right after this element is rendered. + * Note: It's not guaranteed this element is connected to the DOM yet, but it will at least be fully initialized. + */ + afterRender() { + + } + /** * Called when this ignite element is being initialized. When this is called * the element has not been created. This is good for login checking code or special setup code.