mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-04-25 06:19:00 +08:00
fix lint and console warning
This commit is contained in:
parent
85abbbb8fa
commit
ab1e0fa9bf
@ -67,7 +67,7 @@
|
|||||||
|
|
||||||
['mousedown', 'touchstart'].forEach((eventType) => {
|
['mousedown', 'touchstart'].forEach((eventType) => {
|
||||||
resizeHandle.addEventListener(eventType, (evt) => {
|
resizeHandle.addEventListener(eventType, (evt) => {
|
||||||
if (eventType.startsWith('mouse')){
|
if (eventType.startsWith('mouse')) {
|
||||||
if (evt.button !== 0) return;
|
if (evt.button !== 0) return;
|
||||||
} else {
|
} else {
|
||||||
if (evt.changedTouches.length !== 1) return;
|
if (evt.changedTouches.length !== 1) return;
|
||||||
@ -84,7 +84,7 @@
|
|||||||
R.handle = resizeHandle;
|
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')) {
|
||||||
R.screenX = evt.screenX;
|
R.screenX = evt.screenX;
|
||||||
} else {
|
} else {
|
||||||
R.screenX = evt.changedTouches[0].screenX;
|
R.screenX = evt.changedTouches[0].screenX;
|
||||||
@ -104,20 +104,23 @@
|
|||||||
|
|
||||||
['mousemove', 'touchmove'].forEach((eventType) => {
|
['mousemove', 'touchmove'].forEach((eventType) => {
|
||||||
window.addEventListener(eventType, (evt) => {
|
window.addEventListener(eventType, (evt) => {
|
||||||
if (eventType.startsWith('mouse')){
|
if (eventType.startsWith('mouse')) {
|
||||||
if (evt.button !== 0) return;
|
if (evt.button !== 0) return;
|
||||||
} else {
|
} else {
|
||||||
if (evt.changedTouches.length !== 1) return;
|
if (evt.changedTouches.length !== 1) return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (R.tracking) {
|
if (R.tracking) {
|
||||||
|
if (eventType.startsWith('mouse')) {
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
|
}
|
||||||
evt.stopPropagation();
|
evt.stopPropagation();
|
||||||
|
|
||||||
if (eventType.startsWith('mouse')){
|
let delta = 0;
|
||||||
var delta = R.screenX - evt.screenX;
|
if (eventType.startsWith('mouse')) {
|
||||||
|
delta = R.screenX - evt.screenX;
|
||||||
} else {
|
} else {
|
||||||
var delta = R.screenX - evt.changedTouches[0].screenX;
|
delta = R.screenX - evt.changedTouches[0].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);
|
||||||
@ -127,7 +130,7 @@
|
|||||||
|
|
||||||
['mouseup', 'touchend'].forEach((eventType) => {
|
['mouseup', 'touchend'].forEach((eventType) => {
|
||||||
window.addEventListener(eventType, (evt) => {
|
window.addEventListener(eventType, (evt) => {
|
||||||
if (eventType.startsWith('mouse')){
|
if (eventType.startsWith('mouse')) {
|
||||||
if (evt.button !== 0) return;
|
if (evt.button !== 0) return;
|
||||||
} else {
|
} else {
|
||||||
if (evt.changedTouches.length !== 1) return;
|
if (evt.changedTouches.length !== 1) return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user