mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-09 01:20:09 +00:00
@@ -20,7 +20,7 @@ export class ClipspaceDialog extends ComfyDialog {
|
||||
|
||||
static invalidatePreview() {
|
||||
if(ComfyApp.clipspace && ComfyApp.clipspace.imgs && ComfyApp.clipspace.imgs.length > 0) {
|
||||
const img_preview = document.getElementById("clipspace_preview");
|
||||
const img_preview = document.getElementById("clipspace_preview") as HTMLImageElement;
|
||||
if(img_preview) {
|
||||
img_preview.src = ComfyApp.clipspace.imgs[ComfyApp.clipspace['selectedIndex']].src;
|
||||
img_preview.style.maxHeight = "100%";
|
||||
@@ -57,7 +57,7 @@ export class ClipspaceDialog extends ComfyDialog {
|
||||
super();
|
||||
}
|
||||
|
||||
createButtons(self) {
|
||||
createButtons() {
|
||||
const buttons = [];
|
||||
|
||||
for(let idx in ClipspaceDialog.items) {
|
||||
@@ -107,7 +107,7 @@ export class ClipspaceDialog extends ComfyDialog {
|
||||
[
|
||||
$el("option", {value:'selected'}, 'selected'),
|
||||
$el("option", {value:'all'}, 'all')
|
||||
]);
|
||||
]) as HTMLSelectElement;
|
||||
combo2.value = ComfyApp.clipspace['img_paste_mode'];
|
||||
|
||||
const row2 =
|
||||
@@ -141,7 +141,7 @@ export class ClipspaceDialog extends ComfyDialog {
|
||||
show() {
|
||||
const img_preview = document.getElementById("clipspace_preview");
|
||||
ClipspaceDialog.invalidate();
|
||||
|
||||
|
||||
this.element.style.display = "block";
|
||||
}
|
||||
}
|
||||
@@ -152,7 +152,7 @@ app.registerExtension({
|
||||
app.openClipspace =
|
||||
function () {
|
||||
if(!ClipspaceDialog.instance) {
|
||||
ClipspaceDialog.instance = new ClipspaceDialog(app);
|
||||
ClipspaceDialog.instance = new ClipspaceDialog();
|
||||
ComfyApp.clipspace_invalidate_handler = ClipspaceDialog.invalidate;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,9 @@ type Props = {
|
||||
[key: string]: any
|
||||
};
|
||||
|
||||
export function $el(tag: string, propsOrChildren?: string | Element | Element[] | Props, children?: Element[] | Element): HTMLElement {
|
||||
type Children = Element[] | Element | string | string[];
|
||||
|
||||
export function $el(tag: string, propsOrChildren?: Children | Props, children?: Children): HTMLElement {
|
||||
const split = tag.split(".");
|
||||
const element = document.createElement(split.shift() as string);
|
||||
if (split.length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user