From 9f36e9fc838855ae488bea0fbf702b2c1c33174e Mon Sep 17 00:00:00 2001 From: TinyTerra Date: Sun, 24 Sep 2023 21:13:22 +1000 Subject: [PATCH] fullscreen mouse scroll fix --- README.md | 1 + js/ttNfullscreen.js | 31 ++++++++++++++++++++++++------- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 4cd81b1..efefa53 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,7 @@ Navigate to the **_ComfyUI/custom_nodes_** directory with cmd, and run: + 'Right arrow' => _Select Image to the right_ + 'shift + right arrow' => _Select Image 5 to the right_ + 'ctrl + right arrow' => _Select last Image_ + + 'mouse scroll' => _Select image to Left/Right_ + 'esc' => _Close Fullscreen Mode_ **Embedding Auto Complete** diff --git a/js/ttNfullscreen.js b/js/ttNfullscreen.js index f772ed8..e4d5c83 100644 --- a/js/ttNfullscreen.js +++ b/js/ttNfullscreen.js @@ -151,13 +151,30 @@ function _handleArrowKeys(e) { function _handleWheelEvent(e) { e.stopPropagation(); - if (e.deltaY > 0) { - // Scrolling down - ttN_FullscreenImageIndex += 1; - } else if (e.deltaY < 0) { - // Scrolling up - ttN_FullscreenImageIndex -= 1; - if (ttN_FullscreenImageIndex < 0) ttN_FullscreenImageIndex = 0; + + var InvertMenuScrolling = localStorage.getItem('Comfy.Settings.Comfy.InvertMenuScrolling') + console.log("InvertMenuScrolling", InvertMenuScrolling) + + if (InvertMenuScrolling === "true") { + console.log('yes') + if (e.deltaY > 0) { + // Scrolling down + ttN_FullscreenImageIndex += 1; + } else if (e.deltaY < 0) { + // Scrolling up + ttN_FullscreenImageIndex -= 1; + if (ttN_FullscreenImageIndex < 0) ttN_FullscreenImageIndex = 0; + } + } else { + console.log('no') + if (e.deltaY < 0) { + // Scrolling down + ttN_FullscreenImageIndex += 1; + } else if (e.deltaY > 0) { + // Scrolling up + ttN_FullscreenImageIndex -= 1; + if (ttN_FullscreenImageIndex < 0) ttN_FullscreenImageIndex = 0; + } } updateImageElements() }