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
7fd0ccdf
Commit
7fd0ccdf
authored
Aug 22, 2023
by
AUTOMATIC1111
Committed by
GitHub
Aug 22, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #12723 from MMP0/dev-resize-handle-fix
Resize handle improvements and bug fixes
parents
0d90064e
ed49c7c2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
11 deletions
+62
-11
javascript/resizeHandle.js
javascript/resizeHandle.js
+30
-2
style.css
style.css
+32
-9
No files found.
javascript/resizeHandle.js
View file @
7fd0ccdf
...
@@ -66,6 +66,13 @@
...
@@ -66,6 +66,13 @@
parent
.
insertBefore
(
resizeHandle
,
rightCol
);
parent
.
insertBefore
(
resizeHandle
,
rightCol
);
resizeHandle
.
addEventListener
(
'
mousedown
'
,
(
evt
)
=>
{
resizeHandle
.
addEventListener
(
'
mousedown
'
,
(
evt
)
=>
{
if
(
evt
.
button
!==
0
)
return
;
evt
.
preventDefault
();
evt
.
stopPropagation
();
document
.
body
.
classList
.
add
(
'
resizing
'
);
R
.
tracking
=
true
;
R
.
tracking
=
true
;
R
.
parent
=
parent
;
R
.
parent
=
parent
;
R
.
parentWidth
=
parent
.
offsetWidth
;
R
.
parentWidth
=
parent
.
offsetWidth
;
...
@@ -75,20 +82,41 @@
...
@@ -75,20 +82,41 @@
R
.
screenX
=
evt
.
screenX
;
R
.
screenX
=
evt
.
screenX
;
});
});
resizeHandle
.
addEventListener
(
'
dblclick
'
,
()
=>
parent
.
style
.
gridTemplateColumns
=
GRID_TEMPLATE_COLUMNS
);
resizeHandle
.
addEventListener
(
'
dblclick
'
,
(
evt
)
=>
{
evt
.
preventDefault
();
evt
.
stopPropagation
();
parent
.
style
.
gridTemplateColumns
=
GRID_TEMPLATE_COLUMNS
;
});
afterResize
(
parent
);
afterResize
(
parent
);
}
}
window
.
addEventListener
(
'
mousemove
'
,
(
evt
)
=>
{
window
.
addEventListener
(
'
mousemove
'
,
(
evt
)
=>
{
if
(
evt
.
button
!==
0
)
return
;
if
(
R
.
tracking
)
{
if
(
R
.
tracking
)
{
evt
.
preventDefault
();
evt
.
stopPropagation
();
const
delta
=
R
.
screenX
-
evt
.
screenX
;
const
delta
=
R
.
screenX
-
evt
.
screenX
;
const
leftColWidth
=
Math
.
max
(
Math
.
min
(
R
.
leftColStartWidth
-
delta
,
R
.
parent
.
offsetWidth
-
GRADIO_MIN_WIDTH
-
PAD
),
GRADIO_MIN_WIDTH
);
const
leftColWidth
=
Math
.
max
(
Math
.
min
(
R
.
leftColStartWidth
-
delta
,
R
.
parent
.
offsetWidth
-
GRADIO_MIN_WIDTH
-
PAD
),
GRADIO_MIN_WIDTH
);
setLeftColGridTemplate
(
R
.
parent
,
leftColWidth
);
setLeftColGridTemplate
(
R
.
parent
,
leftColWidth
);
}
}
});
});
window
.
addEventListener
(
'
mouseup
'
,
()
=>
R
.
tracking
=
false
);
window
.
addEventListener
(
'
mouseup
'
,
(
evt
)
=>
{
if
(
evt
.
button
!==
0
)
return
;
if
(
R
.
tracking
)
{
evt
.
preventDefault
();
evt
.
stopPropagation
();
R
.
tracking
=
false
;
document
.
body
.
classList
.
remove
(
'
resizing
'
);
}
});
window
.
addEventListener
(
'
resize
'
,
()
=>
{
window
.
addEventListener
(
'
resize
'
,
()
=>
{
...
...
style.css
View file @
7fd0ccdf
...
@@ -142,6 +142,11 @@ div.gradio-container, .block.gradio-textbox, div.gradio-group, div.gradio-dropdo
...
@@ -142,6 +142,11 @@ div.gradio-container, .block.gradio-textbox, div.gradio-group, div.gradio-dropdo
overflow
:
visible
!important
;
overflow
:
visible
!important
;
}
}
/* align-items isn't enough and elements may overflow in Safari. */
.unequal-height
{
align-content
:
flex-start
;
}
/* general styled components */
/* general styled components */
...
@@ -1056,14 +1061,32 @@ div.accordions > div.input-accordion.input-accordion-open{
...
@@ -1056,14 +1061,32 @@ div.accordions > div.input-accordion.input-accordion-open{
top
:
0.5em
;
top
:
0.5em
;
}
}
body
.resizing
{
cursor
:
col-resize
!important
;
}
body
.resizing
*
{
pointer-events
:
none
!important
;
}
body
.resizing
.resize-handle
{
pointer-events
:
initial
!important
;
}
.resize-handle
{
position
:
relative
;
cursor
:
col-resize
;
grid-column
:
2
/
3
;
min-width
:
16px
!important
;
max-width
:
16px
!important
;
height
:
100%
;
}
.resize-handle
{
.resize-handle
::after
{
cursor
:
col-resize
;
content
:
''
;
grid-column
:
2
/
3
;
position
:
absolute
;
min-width
:
8px
!important
;
top
:
0
;
max-width
:
8px
!important
;
bottom
:
0
;
height
:
100%
;
left
:
7.5px
;
border-left
:
1px
dashed
var
(
--border-color-primary
);
border-left
:
1px
dashed
var
(
--border-color-primary
);
user-select
:
none
;
margin-left
:
8px
;
}
}
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