Skip to content

Commit

Permalink
Merge pull request #15010 from light-and-ray/fix_resize-handle_for_ve…
Browse files Browse the repository at this point in the history
…rtical_layout

Fix resize-handle visability for vertical layout (mobile)
  • Loading branch information
AUTOMATIC1111 committed Mar 2, 2024
1 parent eaf5e02 commit b477563
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions javascript/resizeHandle.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,11 @@
function displayResizeHandle(parent) {
if (window.innerWidth < GRADIO_MIN_WIDTH * 2 + PAD * 4) {
parent.style.display = 'flex';
if (R.handle != null) {
R.handle.style.opacity = '0';
}
parent.resizeHandle.style.display = "none";
return false;
} else {
parent.style.display = 'grid';
if (R.handle != null) {
R.handle.style.opacity = '100';
}
parent.resizeHandle.style.display = "block";
return true;
}
}
Expand Down Expand Up @@ -65,6 +61,7 @@
const resizeHandle = document.createElement('div');
resizeHandle.classList.add('resize-handle');
parent.insertBefore(resizeHandle, rightCol);
parent.resizeHandle = resizeHandle;

['mousedown', 'touchstart'].forEach((eventType) => {
resizeHandle.addEventListener(eventType, (evt) => {
Expand All @@ -82,7 +79,6 @@
R.tracking = true;
R.parent = parent;
R.parentWidth = parent.offsetWidth;
R.handle = resizeHandle;
R.leftCol = leftCol;
R.leftColStartWidth = leftCol.offsetWidth;
if (eventType.startsWith('mouse')) {
Expand Down

0 comments on commit b477563

Please sign in to comment.