Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When using the --hide-ui-dir-config parameter, [Send to Photopea] button is not displayed. #9

Closed
Odls opened this issue May 31, 2023 · 1 comment

Comments

@Odls
Copy link

Odls commented May 31, 2023

In the photopea-bindings.js file at line 32, this code generates the [Send to Photopea] button:

function createSendToPhotopeaButton(queryId, gallery) {
    const existingButton = gradioApp().querySelector(`#${queryId} button`);
    const newButton = existingButton.cloneNode(true);
    newButton.id = `${queryId}_open_in_photopea`;
    newButton.textContent = "Send to Photopea";
    newButton.addEventListener("click", () => openImageInPhotopea(gallery));
    gradioApp().querySelector(`#${queryId}`).appendChild(newButton);
}

It clones the first button inside #${queryId}, which is [Open images output directory] button.

When using the --hide-ui-dir-config parameter, this button is hidden, and the cloned [Send to Photopea] button is also hidden.

Set display to "flex" in createSendToPhotopeaButton should solve this problem:

newButton.style.display = "flex";
@yankooliveira
Copy link
Owner

Nice catch, many thanks! Fix added to the latest version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants