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
403c5dba
Commit
403c5dba
authored
Oct 28, 2022
by
Florian Horn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hide save btn for other tabs than txt2img and img2img
parent
bf25b51c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
javascript/imageviewer.js
javascript/imageviewer.js
+12
-2
No files found.
javascript/imageviewer.js
View file @
403c5dba
...
...
@@ -13,6 +13,15 @@ function showModal(event) {
}
lb
.
style
.
display
=
"
block
"
;
lb
.
focus
()
const
tabTxt2Img
=
gradioApp
().
getElementById
(
"
tab_txt2img
"
)
const
tabImg2Img
=
gradioApp
().
getElementById
(
"
tab_img2img
"
)
// show the save button in modal only on txt2img or img2img tabs
if
(
tabTxt2Img
.
style
.
display
!=
"
none
"
||
tabImg2Img
.
style
.
display
!=
"
none
"
)
{
gradioApp
().
getElementById
(
"
modal_save
"
).
style
.
display
=
"
inline
"
}
else
{
gradioApp
().
getElementById
(
"
modal_save
"
).
style
.
display
=
"
none
"
}
event
.
stopPropagation
()
}
...
...
@@ -86,9 +95,9 @@ function saveImage(){
const
tabImg2Img
=
gradioApp
().
getElementById
(
"
tab_img2img
"
)
const
saveTxt2Img
=
"
save_txt2img
"
const
saveImg2Img
=
"
save_img2img
"
if
(
tabTxt2Img
.
style
[
"
display
"
]
!=
"
none
"
)
{
if
(
tabTxt2Img
.
style
.
display
!=
"
none
"
)
{
gradioApp
().
getElementById
(
saveTxt2Img
).
click
()
}
else
if
(
tabImg2Img
.
style
[
"
display
"
]
!=
"
none
"
)
{
}
else
if
(
tabImg2Img
.
style
.
display
!=
"
none
"
)
{
gradioApp
().
getElementById
(
saveImg2Img
).
click
()
}
else
{
console
.
error
(
"
missing implementation for saving modal of this type
"
)
...
...
@@ -222,6 +231,7 @@ document.addEventListener("DOMContentLoaded", function() {
const
modalSave
=
document
.
createElement
(
"
span
"
)
modalSave
.
className
=
"
modalSave cursor
"
modalSave
.
id
=
"
modal_save
"
modalSave
.
innerHTML
=
"
🖫
"
modalSave
.
addEventListener
(
"
click
"
,
modalSaveImage
,
true
)
modalSave
.
title
=
"
Save Image(s)
"
...
...
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