Update WorkflowCollection.js

This commit is contained in:
JAlB- 2023-04-01 22:41:05 +03:00 committed by GitHub
parent e7f23096cd
commit 7ff0419027
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,6 +23,8 @@ class WC{
constructor(TARGET){ constructor(TARGET){
this.mainFrame = $Add('div', TARGET, {className : 'topMenu'}); this.mainFrame = $Add('div', TARGET, {className : 'topMenu'});
this.comfyMenuHidden = false;
this.loader = $Add("input", $d.body, { this.loader = $Add("input", $d.body, {
type: "file", type: "file",
accept: ".json", accept: ".json",
@ -36,7 +38,7 @@ class WC{
this.Title = $Add('span', this.mainFrame, {innerHTML: 'ComfyUI', className : 'title'}); this.Title = $Add('span', this.mainFrame, {innerHTML: 'ComfyUI', className : 'title'});
this.queuePanel = $Add('span', this.mainFrame, {style : {position: 'absolute', right: 0} } ); this.queuePanel = $Add('span', this.mainFrame, {style : {position: 'absolute', right: 0} } );
this.queueInfoButton = $Add('span', this.queuePanel, {innerHTML : '≡', className : 'button'}); this.queueInfoButton = $Add('span', this.queuePanel, {innerHTML : '≡', className : 'button', onclick : ()=>{this.showHideComfyMenu()} } );
this.generateButton = $Add('span', this.queuePanel, {innerHTML : 'GENERATE', className : 'button' , onclick : function(){app.queuePrompt(0, this.batchCount)} } ); this.generateButton = $Add('span', this.queuePanel, {innerHTML : 'GENERATE', className : 'button' , onclick : function(){app.queuePrompt(0, this.batchCount)} } );
this.controlPanel = $Add('span', this.mainFrame, {className : 'workflowControlPanel'}); this.controlPanel = $Add('span', this.mainFrame, {className : 'workflowControlPanel'});
@ -70,6 +72,14 @@ class WC{
this.opened = true; this.opened = true;
//this.slide(); //this.slide();
} }
showHideComfyMenu(){
if (this.comfyMenuHidden){
qs('.comfy-menu').style.display = '';
}else{
qs('.comfy-menu').style.display = 'none';
}
this.comfyMenuHidden = !this.comfyMenuHidden;
}
slide(){ slide(){
if (this.opened){ if (this.opened){
this.opened = !this.opened; this.opened = !this.opened;