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
68df2817
Commit
68df2817
authored
Jul 06, 2024
by
AUTOMATIC1111
Committed by
GitHub
Jul 06, 2024
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #16065 from AUTOMATIC1111/ToggleLivePriview-in-image-viewer
ToggleLivePriview button in image viewer
parents
4cc3add7
775fa769
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
javascript/imageviewer.js
javascript/imageviewer.js
+17
-0
No files found.
javascript/imageviewer.js
View file @
68df2817
...
@@ -6,6 +6,8 @@ function closeModal() {
...
@@ -6,6 +6,8 @@ function closeModal() {
function
showModal
(
event
)
{
function
showModal
(
event
)
{
const
source
=
event
.
target
||
event
.
srcElement
;
const
source
=
event
.
target
||
event
.
srcElement
;
const
modalImage
=
gradioApp
().
getElementById
(
"
modalImage
"
);
const
modalImage
=
gradioApp
().
getElementById
(
"
modalImage
"
);
const
modalToggleLivePreviewBtn
=
gradioApp
().
getElementById
(
"
modal_toggle_live_preview
"
);
modalToggleLivePreviewBtn
.
innerHTML
=
opts
.
js_live_preview_in_modal_lightbox
?
"
🗇
"
:
"
🗆
"
;
const
lb
=
gradioApp
().
getElementById
(
"
lightboxModal
"
);
const
lb
=
gradioApp
().
getElementById
(
"
lightboxModal
"
);
modalImage
.
src
=
source
.
src
;
modalImage
.
src
=
source
.
src
;
if
(
modalImage
.
style
.
display
===
'
none
'
)
{
if
(
modalImage
.
style
.
display
===
'
none
'
)
{
...
@@ -152,6 +154,13 @@ function modalZoomToggle(event) {
...
@@ -152,6 +154,13 @@ function modalZoomToggle(event) {
event
.
stopPropagation
();
event
.
stopPropagation
();
}
}
function
modalLivePreviewToggle
(
event
)
{
const
modalToggleLivePreview
=
gradioApp
().
getElementById
(
"
modal_toggle_live_preview
"
);
opts
.
js_live_preview_in_modal_lightbox
=
!
opts
.
js_live_preview_in_modal_lightbox
;
modalToggleLivePreview
.
innerHTML
=
opts
.
js_live_preview_in_modal_lightbox
?
"
🗇
"
:
"
🗆
"
;
event
.
stopPropagation
();
}
function
modalTileImageToggle
(
event
)
{
function
modalTileImageToggle
(
event
)
{
const
modalImage
=
gradioApp
().
getElementById
(
"
modalImage
"
);
const
modalImage
=
gradioApp
().
getElementById
(
"
modalImage
"
);
const
modal
=
gradioApp
().
getElementById
(
"
lightboxModal
"
);
const
modal
=
gradioApp
().
getElementById
(
"
lightboxModal
"
);
...
@@ -209,6 +218,14 @@ document.addEventListener("DOMContentLoaded", function() {
...
@@ -209,6 +218,14 @@ document.addEventListener("DOMContentLoaded", function() {
modalSave
.
title
=
"
Save Image(s)
"
;
modalSave
.
title
=
"
Save Image(s)
"
;
modalControls
.
appendChild
(
modalSave
);
modalControls
.
appendChild
(
modalSave
);
const
modalToggleLivePreview
=
document
.
createElement
(
'
span
'
);
modalToggleLivePreview
.
className
=
'
modalToggleLivePreview cursor
'
;
modalToggleLivePreview
.
id
=
"
modal_toggle_live_preview
"
;
modalToggleLivePreview
.
innerHTML
=
"
🗆
"
;
modalToggleLivePreview
.
onclick
=
modalLivePreviewToggle
;
modalToggleLivePreview
.
title
=
"
Toggle live preview
"
;
modalControls
.
appendChild
(
modalToggleLivePreview
);
const
modalClose
=
document
.
createElement
(
'
span
'
);
const
modalClose
=
document
.
createElement
(
'
span
'
);
modalClose
.
className
=
'
modalClose cursor
'
;
modalClose
.
className
=
'
modalClose cursor
'
;
modalClose
.
innerHTML
=
'
×
'
;
modalClose
.
innerHTML
=
'
×
'
;
...
...
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