Reverted behavior on 'O' shortcut to open image in same tab (#101)

Co-authored-by: yoditax@net.com <yoditax@net.com>
This commit is contained in:
yoditax 2021-03-03 12:20:52 -03:00 committed by GitHub
parent 7fa9cd56f6
commit 63bb8285d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -13,6 +13,13 @@ function openFullView() {
const imageHover = $('[data-uris]:hover'); const imageHover = $('[data-uris]:hover');
if (!imageHover) return; 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); window.open(JSON.parse(imageHover.dataset.uris).full);
} }
@ -35,7 +42,7 @@ const keyCodes = {
83() { click('.js-source-link'); }, // S - go to image source 83() { click('.js-source-link'); }, // S - go to image source
76() { click('.js-tag-sauce-toggle'); }, // L - edit tags 76() { click('.js-tag-sauce-toggle'); }, // L - edit tags
79() { openFullView() }, // O - open original 79() { openFullView() }, // O - open original
86() { openFullView() }, // V - open original 86() { openFullViewNewTab() }, // V - open original in a new tab
70() { // F - favourite image 70() { // F - favourite image
getHover() ? click(`a.interaction--fave[data-image-id="${getHover()}"]`) getHover() ? click(`a.interaction--fave[data-image-id="${getHover()}"]`)
: click('.block__header a.interaction--fave'); : click('.block__header a.interaction--fave');