mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-01-04 13:55:06 +08:00
fix resize handle
This commit is contained in:
parent
bab918f049
commit
6e6cc2922d
@ -23,17 +23,11 @@
|
|||||||
function displayResizeHandle(parent) {
|
function displayResizeHandle(parent) {
|
||||||
if (window.innerWidth < GRADIO_MIN_WIDTH * 2 + PAD * 4) {
|
if (window.innerWidth < GRADIO_MIN_WIDTH * 2 + PAD * 4) {
|
||||||
parent.style.display = 'flex';
|
parent.style.display = 'flex';
|
||||||
parent.querySelector('.resize-handle').style.display = "none";
|
parent.resizeHandle.style.display = "none";
|
||||||
if (R.handle != null) {
|
|
||||||
R.handle.style.opacity = '0';
|
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
parent.style.display = 'grid';
|
parent.style.display = 'grid';
|
||||||
parent.querySelector('.resize-handle').style.display = 'block';
|
parent.resizeHandle.style.display = "block";
|
||||||
if (R.handle != null) {
|
|
||||||
R.handle.style.opacity = '100';
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -66,6 +60,7 @@
|
|||||||
const resizeHandle = document.createElement('div');
|
const resizeHandle = document.createElement('div');
|
||||||
resizeHandle.classList.add('resize-handle');
|
resizeHandle.classList.add('resize-handle');
|
||||||
parent.insertBefore(resizeHandle, rightCol);
|
parent.insertBefore(resizeHandle, rightCol);
|
||||||
|
parent.resizeHandle = resizeHandle;
|
||||||
|
|
||||||
['mousedown', 'touchstart'].forEach((eventType) => {
|
['mousedown', 'touchstart'].forEach((eventType) => {
|
||||||
resizeHandle.addEventListener(eventType, (evt) => {
|
resizeHandle.addEventListener(eventType, (evt) => {
|
||||||
@ -83,7 +78,6 @@
|
|||||||
R.tracking = true;
|
R.tracking = true;
|
||||||
R.parent = parent;
|
R.parent = parent;
|
||||||
R.parentWidth = parent.offsetWidth;
|
R.parentWidth = parent.offsetWidth;
|
||||||
R.handle = resizeHandle;
|
|
||||||
R.leftCol = leftCol;
|
R.leftCol = leftCol;
|
||||||
R.leftColStartWidth = leftCol.offsetWidth;
|
R.leftColStartWidth = leftCol.offsetWidth;
|
||||||
if (eventType.startsWith('mouse')) {
|
if (eventType.startsWith('mouse')) {
|
||||||
|
Loading…
Reference in New Issue
Block a user