Visual improvements to debug mode for better information visibility
This commit is contained in:
@@ -12,14 +12,17 @@ function createDebugDom() {
|
||||
addEventListener(name, listener) { this.listeners[name] = listener; },
|
||||
focus() { document.activeElement = this; },
|
||||
querySelectorAll(selector) {
|
||||
return descendants(this).filter(node => node.tag === "details"
|
||||
&& node.getAttribute("data-request-id") && (!selector.includes("[open]") || node.open));
|
||||
return descendants(this).filter(node => selector.startsWith(".")
|
||||
? (node.className || "").split(" ").includes(selector.slice(1))
|
||||
: node.tag === "details" && node.getAttribute("data-request-id") && (!selector.includes("[open]") || node.open));
|
||||
}
|
||||
};
|
||||
}
|
||||
const panel = element("aside");
|
||||
Object.assign(document, { getElementById: () => panel, createElement: element, createElementNS: (_, tag) => element(tag) });
|
||||
return { document, panel, descendants };
|
||||
const modal = element("main");
|
||||
modal.append(panel);
|
||||
Object.assign(document, { getElementById: id => id === "opportunities-extension-modal" ? modal : panel, createElement: element, createElementNS: (_, tag) => element(tag) });
|
||||
return { document, panel, modal, descendants };
|
||||
}
|
||||
|
||||
module.exports = { createDebugDom };
|
||||
|
||||
Reference in New Issue
Block a user