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
db5c304e
Commit
db5c304e
authored
Aug 20, 2023
by
AUTOMATIC1111
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make live previews play nice with window/slider resizes
parent
a0d721e1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
25 deletions
+15
-25
extensions-builtin/mobile/javascript/mobile.js
extensions-builtin/mobile/javascript/mobile.js
+2
-0
javascript/progressbar.js
javascript/progressbar.js
+4
-17
style.css
style.css
+9
-8
No files found.
extensions-builtin/mobile/javascript/mobile.js
View file @
db5c304e
...
...
@@ -20,6 +20,8 @@ function reportWindowSize() {
var
button
=
gradioApp
().
getElementById
(
tab
+
'
_generate_box
'
);
var
target
=
gradioApp
().
getElementById
(
currentlyMobile
?
tab
+
'
_results
'
:
tab
+
'
_actions_column
'
);
target
.
insertBefore
(
button
,
target
.
firstElementChild
);
gradioApp
().
getElementById
(
tab
+
'
_results
'
).
classList
.
toggle
(
'
mobile
'
,
currentlyMobile
);
}
}
...
...
javascript/progressbar.js
View file @
db5c304e
...
...
@@ -69,7 +69,6 @@ function requestProgress(id_task, progressbarContainer, gallery, atEnd, onProgre
var
dateStart
=
new
Date
();
var
wasEverActive
=
false
;
var
parentProgressbar
=
progressbarContainer
.
parentNode
;
var
parentGallery
=
gallery
?
gallery
.
parentNode
:
null
;
var
divProgress
=
document
.
createElement
(
'
div
'
);
divProgress
.
className
=
'
progressDiv
'
;
...
...
@@ -80,16 +79,16 @@ function requestProgress(id_task, progressbarContainer, gallery, atEnd, onProgre
divProgress
.
appendChild
(
divInner
);
parentProgressbar
.
insertBefore
(
divProgress
,
progressbarContainer
);
if
(
parentG
allery
)
{
if
(
g
allery
)
{
var
livePreview
=
document
.
createElement
(
'
div
'
);
livePreview
.
className
=
'
livePreview
'
;
parentGallery
.
insertBefore
(
livePreview
,
gallery
);
gallery
.
insertBefore
(
livePreview
,
gallery
.
firstElementChild
);
}
var
removeProgressBar
=
function
()
{
setTitle
(
""
);
parentProgressbar
.
removeChild
(
divProgress
);
if
(
parentGallery
)
parentG
allery
.
removeChild
(
livePreview
);
if
(
gallery
)
g
allery
.
removeChild
(
livePreview
);
atEnd
();
};
...
...
@@ -100,12 +99,6 @@ function requestProgress(id_task, progressbarContainer, gallery, atEnd, onProgre
return
;
}
var
rect
=
progressbarContainer
.
getBoundingClientRect
();
if
(
rect
.
width
)
{
divProgress
.
style
.
width
=
rect
.
width
+
"
px
"
;
}
let
progressText
=
""
;
divInner
.
style
.
width
=
((
res
.
progress
||
0
)
*
100.0
)
+
'
%
'
;
...
...
@@ -151,17 +144,11 @@ function requestProgress(id_task, progressbarContainer, gallery, atEnd, onProgre
},
function
()
{
removeProgressBar
();
});
}
}
;
var
funLivePreview
=
function
(
id_task
,
id_live_preview
)
{
request
(
"
./internal/progress
"
,
{
id_task
:
id_task
,
id_live_preview
:
id_live_preview
},
function
(
res
)
{
if
(
res
.
live_preview
&&
gallery
)
{
rect
=
gallery
.
getBoundingClientRect
();
if
(
rect
.
width
)
{
livePreview
.
style
.
width
=
rect
.
width
+
"
px
"
;
livePreview
.
style
.
height
=
rect
.
height
+
"
px
"
;
}
var
img
=
new
Image
();
img
.
onload
=
function
()
{
livePreview
.
appendChild
(
img
);
...
...
style.css
View file @
db5c304e
...
...
@@ -499,11 +499,15 @@ table.popup-table .link{
/* live preview */
.progressDiv
{
position
:
relativ
e
;
position
:
absolut
e
;
height
:
20px
;
background
:
#b4c0cc
;
border-radius
:
3px
!important
;
margin-bottom
:
-3px
;
top
:
-20px
;
}
[
id
$
=
_results
]
.mobile
{
margin-top
:
28px
;
}
.dark
.progressDiv
{
...
...
@@ -528,12 +532,9 @@ table.popup-table .link{
.livePreview
{
position
:
absolute
;
z-index
:
300
;
background-color
:
white
;
margin
:
-4px
;
}
.dark
.livePreview
{
background-color
:
rgb
(
17
24
39
/
var
(
--tw-bg-opacity
));
background
:
var
(
--background-fill-primary
);
width
:
100%
;
height
:
100%
;
}
.livePreview
img
{
...
...
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