This commit is contained in:
space-nuko
2023-05-06 15:25:57 -05:00
parent 81618da303
commit faf22fccf4
4 changed files with 32 additions and 17 deletions

View File

@@ -232,17 +232,17 @@ export default class ComfyApp {
} }
private addDropHandler() { private addDropHandler() {
this.dropZone = document.getElementById("dropzone"); // this.dropZone = document.getElementById("dropzone");
if (this.dropZone) { // if (this.dropZone) {
window.addEventListener('dragenter', this.allowDrag.bind(this)); // window.addEventListener('dragenter', this.allowDrag.bind(this));
this.dropZone.addEventListener('dragover', this.allowDrag.bind(this)); // this.dropZone.addEventListener('dragover', this.allowDrag.bind(this));
this.dropZone.addEventListener('dragleave', this.hideDropZone.bind(this)); // this.dropZone.addEventListener('dragleave', this.hideDropZone.bind(this));
this.dropZone.addEventListener('drop', this.handleDrop.bind(this)); // this.dropZone.addEventListener('drop', this.handleDrop.bind(this));
} // }
else { // else {
console.warn("No dropzone detected (probably on mobile).") // console.warn("No dropzone detected (probably on mobile).")
} // }
} }
/** /**

View File

@@ -40,6 +40,9 @@
for (const cat of Object.values(ALL_ATTRIBUTES)) { for (const cat of Object.values(ALL_ATTRIBUTES)) {
for (const spec of Object.values(cat.specs)) { for (const spec of Object.values(cat.specs)) {
if (spec.location === "widget" && target.attrs[spec.name] == null) { if (spec.location === "widget" && target.attrs[spec.name] == null) {
if (!spec.editable)
continue;
if (spec.canShow && !spec.canShow(target)) if (spec.canShow && !spec.canShow(target))
continue; continue;
@@ -117,7 +120,7 @@
} }
function updateAttribute(spec: AttributesSpec, target: IDragItem | null, value: any) { function updateAttribute(spec: AttributesSpec, target: IDragItem | null, value: any) {
if (target == null) if (target == null || !spec.editable)
return; return;
const name = spec.name const name = spec.name
@@ -142,7 +145,7 @@
} }
function updateProperty(spec: AttributesSpec, value: any) { function updateProperty(spec: AttributesSpec, value: any) {
if (node == null) if (node == null || !spec.editable)
return return
const name = spec.name const name = spec.name
@@ -170,7 +173,7 @@
} }
function updateVar(spec: AttributesSpec, value: any) { function updateVar(spec: AttributesSpec, value: any) {
if (node == null) if (node == null || !spec.editable)
return; return;
const name = spec.name const name = spec.name
@@ -190,8 +193,11 @@
$refreshPanel += 1; $refreshPanel += 1;
} }
function updateWorkflowAttribute(entry: AttributesSpec, value: any) { function updateWorkflowAttribute(spec: AttributesSpec, value: any) {
const name = entry.name if (!spec.editable)
return;
const name = spec.name
console.warn("updateWorkflowAttribute", name, value) console.warn("updateWorkflowAttribute", name, value)
$layoutState.attrs[name] = value $layoutState.attrs[name] = value
@@ -389,6 +395,11 @@
padding: 0.8rem 1.0rem; padding: 0.8rem 1.0rem;
.title { .title {
font-weight: bold;
.type {
padding-left: 0.25rem;
font-weight: normal;
} }
} }
} }

View File

@@ -25,10 +25,14 @@
width: var(--size-12); width: var(--size-12);
height: var(--size-12); height: var(--size-12);
> :global(.lg) { > :global(.secondary.lg) {
border: var(--button-border-width) solid var(--neutral-400); border: var(--button-border-width) solid var(--neutral-400);
} }
> :global(.primary.lg) {
border: var(--button-border-width) solid var(--primary-400);
}
&.toggled { &.toggled {
:global(svg) { :global(svg) {
color: var(--button-primary-text-color); color: var(--button-primary-text-color);

View File

@@ -20,7 +20,7 @@ const store: WritableUIStateStore = writable(
graphLocked: false, graphLocked: false,
nodesLocked: false, nodesLocked: false,
autoAddUI: true, autoAddUI: true,
uiUnlocked: true, uiUnlocked: false,
uiEditMode: "widgets" uiEditMode: "widgets"
}) })