Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
Stable Diffusion Webui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
novelai-storage
Stable Diffusion Webui
Commits
957185f7
Commit
957185f7
authored
Jun 30, 2024
by
w-e-w
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix Replace preview
fix broken Replace preview for extra networks tabs edit metadata caused by #11808
parent
a30b19dd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
javascript/ui.js
javascript/ui.js
+8
-0
modules/ui_extra_networks_user_metadata.py
modules/ui_extra_networks_user_metadata.py
+1
-1
No files found.
javascript/ui.js
View file @
957185f7
...
...
@@ -26,6 +26,14 @@ function selected_gallery_index() {
return
all_gallery_buttons
().
findIndex
(
elem
=>
elem
.
classList
.
contains
(
'
selected
'
));
}
function
gallery_container_buttons
(
gallery_container
)
{
return
gradioApp
().
querySelectorAll
(
`#
${
gallery_container
}
.thumbnail-item.thumbnail-small`
);
}
function
selected_gallery_index_id
(
gallery_container
)
{
return
Array
.
from
(
gallery_container_buttons
(
gallery_container
)).
findIndex
(
elem
=>
elem
.
classList
.
contains
(
'
selected
'
));
}
function
extract_image_from_gallery
(
gallery
)
{
if
(
gallery
.
length
==
0
)
{
return
[
null
];
...
...
modules/ui_extra_networks_user_metadata.py
View file @
957185f7
...
...
@@ -194,7 +194,7 @@ class UserMetadataEditor:
def
setup_ui
(
self
,
gallery
):
self
.
button_replace_preview
.
click
(
fn
=
self
.
save_preview
,
_js
=
"function(x, y, z){return [selected_gallery_index(), y, z]
}"
,
_js
=
f
"function(x, y, z){{return [selected_gallery_index_id('{self.tabname + '_gallery_container'}'), y, z]}
}"
,
inputs
=
[
self
.
edit_name_input
,
gallery
,
self
.
edit_name_input
],
outputs
=
[
self
.
html_preview
,
self
.
html_status
]
)
.
then
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment