Skip to content

Commit

Permalink
Fix generate button swapping places when mobile layout is triggered
Browse files Browse the repository at this point in the history
  • Loading branch information
catboxanon committed Aug 20, 2023
1 parent 6fd1862 commit 738ccc2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion extensions-builtin/mobile/javascript/mobile.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ function reportWindowSize() {

for (var tab of ["txt2img", "img2img"]) {
var button = gradioApp().getElementById(tab + '_generate_box');
var target = gradioApp().getElementById(currentlyMobile ? tab + '_results' : tab + '_actions_column');
var target = null;
if (currentlyMobile) {
target = gradioApp().getElementById(tab + '_results');
} else {
target = gradioApp().getElementById(tab + '_actions_column') || gradioApp().getElementById(tab + '_generate_row');
}

Check failure on line 27 in extensions-builtin/mobile/javascript/mobile.js

View workflow job for this annotation

GitHub Actions / eslint

Trailing spaces not allowed
target.insertBefore(button, target.firstElementChild);
}
}
Expand Down
2 changes: 1 addition & 1 deletion modules/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def __init__(self, is_img2img: bool, toprow_prompt: ToprowPrompt, in_settings_co

with gr.Row(elem_id=f"{id_part}_toprow", variant="compact"):
if in_settings_column:
with gr.Row(elem_classes=self.flex_revert):
with gr.Row(elem_id=f"{id_part}_generate_row", elem_classes=self.flex_revert):
self._create_generate_box()

with gr.Column(elem_id=f"{id_part}_prompt_container", scale=6):
Expand Down

0 comments on commit 738ccc2

Please sign in to comment.