[handle_pixel] better zoom logic

This commit is contained in:
Noz 2024-02-20 22:56:10 -05:00 committed by Shish
parent 3b5976c334
commit 3f064c3336

View file

@ -38,9 +38,17 @@ document.addEventListener('DOMContentLoaded', () => {
}); });
$("img.shm-main-image").click(function(e) { $("img.shm-main-image").click(function(e) {
switch(shm_cookie_get("ui-image-zoom")) { var val = $(".shm-zoomer")[0].value;
case "full": zoom("both"); break; var cookie = shm_cookie_get("ui-image-zoom");
default: zoom("full"); break;
if (val == "full" && cookie == "full"){
zoom("both", false);
}
else if (val != "full"){
zoom("full", false);
}
else {
zoom(cookie, false);
} }
}); });