Add th-debug-element hook and data-debug-element minimal useful info (#9281)

* add th-debug-element hook and date-debug-element minimal useful info

* invoke th-dom-rendering-element hook

* improve comment
This commit is contained in:
Mario Pietsch
2025-10-07 13:02:08 +02:00
committed by GitHub
parent dc7f2a57bb
commit 4552c117fc

View File

@@ -74,6 +74,8 @@ ElementWidget.prototype.render = function(parent,nextSibling) {
// Create the DOM node and render children
var domNode = this.document.createElementNS(this.namespace,this.tag);
this.assignAttributes(domNode,{excludeEventAttributes: true});
// Allow hooks to manipulate the DOM node. Eg: Add debug info
$tw.hooks.invokeHook("th-dom-rendering-element", domNode, this);
parent.insertBefore(domNode,nextSibling);
this.renderChildren(domNode,null);
this.domNodes.push(domNode);