fix: add container to the buttons injected into the right menu
This commit is contained in:
parent
73853a60ff
commit
230cee40d2
@ -2120,7 +2120,7 @@ function addQueueButtons(buttonConfigs = DEFAULT_BUTTONS) {
|
|||||||
|
|
||||||
// Function to add butons to the menu right
|
// Function to add butons to the menu right
|
||||||
function addMenuRightButtons(buttonConfigs) {
|
function addMenuRightButtons(buttonConfigs) {
|
||||||
const menuRightButtons = document.querySelector('.comfyui-menu-right')
|
const menuRightButtons = document.querySelector('.comfyui-menu-right .flex')
|
||||||
|
|
||||||
if (!menuRightButtons) return
|
if (!menuRightButtons) return
|
||||||
|
|
||||||
@ -2130,18 +2130,21 @@ function addMenuRightButtons(buttonConfigs) {
|
|||||||
button.remove()
|
button.remove()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!menuRightButtons) return
|
const container = document.createElement('div')
|
||||||
|
container.className = 'comfyui-button-group mx-2'
|
||||||
|
|
||||||
for (const config of buttonConfigs) {
|
for (const config of buttonConfigs) {
|
||||||
const button = createMenuRightButton(config)
|
const button = createMenuRightButton(config)
|
||||||
menuRightButtons.appendChild(button)
|
container.appendChild(button)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
menuRightButtons.appendChild(container)
|
||||||
}
|
}
|
||||||
|
|
||||||
function createMenuRightButton(config) {
|
function createMenuRightButton(config) {
|
||||||
const button = document.createElement('button')
|
const button = document.createElement('button')
|
||||||
button.id = `cd-button-${config.id}`
|
button.id = `cd-button-${config.id}`
|
||||||
button.className = 'p-button p-component p-button-secondary p-button-md'
|
button.className = `p-button p-component p-button-secondary p-button-md ${config.btnClasses}`
|
||||||
button.innerHTML = `
|
button.innerHTML = `
|
||||||
<span class="p-button-icon pi ${config.icon}"></span>
|
<span class="p-button-icon pi ${config.icon}"></span>
|
||||||
<span class="p-button-label">${config.label}</span>
|
<span class="p-button-label">${config.label}</span>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user