From 63bb8285d98b88d482b78fe3eaa596f4b3b052aa Mon Sep 17 00:00:00 2001 From: yoditax Date: Wed, 3 Mar 2021 12:20:52 -0300 Subject: [PATCH] Reverted behavior on 'O' shortcut to open image in same tab (#101) Co-authored-by: yoditax@net.com --- assets/js/shortcuts.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/assets/js/shortcuts.js b/assets/js/shortcuts.js index 0f4396d8..0a43b3ef 100644 --- a/assets/js/shortcuts.js +++ b/assets/js/shortcuts.js @@ -13,6 +13,13 @@ function openFullView() { const imageHover = $('[data-uris]:hover'); if (!imageHover) return; + window.location = JSON.parse(imageHover.dataset.uris).full; +} + +function openFullViewNewTab() { + const imageHover = $('[data-uris]:hover'); + if (!imageHover) return; + window.open(JSON.parse(imageHover.dataset.uris).full); } @@ -35,7 +42,7 @@ const keyCodes = { 83() { click('.js-source-link'); }, // S - go to image source 76() { click('.js-tag-sauce-toggle'); }, // L - edit tags 79() { openFullView() }, // O - open original - 86() { openFullView() }, // V - open original + 86() { openFullViewNewTab() }, // V - open original in a new tab 70() { // F - favourite image getHover() ? click(`a.interaction--fave[data-image-id="${getHover()}"]`) : click('.block__header a.interaction--fave');