mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-30 03:01:54 +00:00
Attach DOM widgets to canvas container instead of document body (#364)
This commit is contained in:
@@ -264,7 +264,7 @@ LGraphNode.prototype.addDOMWidget = function (
|
|||||||
options = { hideOnZoom: true, selectOn: ['focus', 'click'], ...options }
|
options = { hideOnZoom: true, selectOn: ['focus', 'click'], ...options }
|
||||||
|
|
||||||
if (!element.parentElement) {
|
if (!element.parentElement) {
|
||||||
document.body.append(element)
|
app.canvasContainer.append(element)
|
||||||
}
|
}
|
||||||
element.hidden = true
|
element.hidden = true
|
||||||
element.style.display = 'none'
|
element.style.display = 'none'
|
||||||
@@ -335,8 +335,8 @@ LGraphNode.prototype.addDOMWidget = function (
|
|||||||
Object.assign(element.style, {
|
Object.assign(element.style, {
|
||||||
transformOrigin: '0 0',
|
transformOrigin: '0 0',
|
||||||
transform: scale,
|
transform: scale,
|
||||||
left: `${transform.a + transform.e + elRect.left}px`,
|
left: `${transform.a + transform.e}px`,
|
||||||
top: `${transform.d + transform.f + elRect.top}px`,
|
top: `${transform.d + transform.f}px`,
|
||||||
width: `${widgetWidth - margin * 2}px`,
|
width: `${widgetWidth - margin * 2}px`,
|
||||||
height: `${(widget.computedHeight ?? 50) - margin * 2}px`,
|
height: `${(widget.computedHeight ?? 50) - margin * 2}px`,
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
|
|||||||
Reference in New Issue
Block a user