From e45cbc00c8d93aa646efc755269a1b3ed27ce52d Mon Sep 17 00:00:00 2001 From: yoditax Date: Tue, 24 Nov 2020 16:58:30 -0300 Subject: [PATCH] Added new shortcut to open full images 'V'. Changed behavior to open new tab (#68) Co-authored-by: yoditax@net.com --- assets/js/shortcuts.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/assets/js/shortcuts.js b/assets/js/shortcuts.js index bfbb0491..0f4396d8 100644 --- a/assets/js/shortcuts.js +++ b/assets/js/shortcuts.js @@ -13,7 +13,7 @@ function openFullView() { const imageHover = $('[data-uris]:hover'); if (!imageHover) return; - window.location = JSON.parse(imageHover.dataset.uris).full; + window.open(JSON.parse(imageHover.dataset.uris).full); } function click(selector) { @@ -35,6 +35,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 70() { // F - favourite image getHover() ? click(`a.interaction--fave[data-image-id="${getHover()}"]`) : click('.block__header a.interaction--fave');