Added a new after render function for elements.

This commit is contained in:
MattMo 2024-03-18 09:33:16 -07:00
parent 9040bb8d45
commit 939d1ec83a

@ -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.