From 213766fac92eca61ed648467ef7ecd182d74f41f Mon Sep 17 00:00:00 2001 From: evazion Date: Thu, 18 Jun 2020 12:24:32 -0500 Subject: [PATCH] posts: fix "view original" not working on mobile. ref: https://github.com/danbooru/danbooru/commit/38f385d1ca93dba6d7de9f228f61c1f9a1eb4c27#r40000777 --- app/javascript/src/javascripts/posts.js.erb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/javascript/src/javascripts/posts.js.erb b/app/javascript/src/javascripts/posts.js.erb index cdf7b9aaf..9eef63e88 100644 --- a/app/javascript/src/javascripts/posts.js.erb +++ b/app/javascript/src/javascripts/posts.js.erb @@ -300,10 +300,10 @@ Post.initialize_favlist = function() { }); } -Post.view_original = function(e) { +Post.view_original = function(e = null) { if (Utility.test_max_width(660)) { // Do the default behavior (navigate to image) - return false; + return; } var $image = $("#image"); @@ -316,13 +316,13 @@ Post.view_original = function(e) { }); Note.Box.scale_all(); $("body").attr("data-post-current-image-size", "original"); - return false; + e?.preventDefault(); } -Post.view_large = function(e) { +Post.view_large = function(e = null) { if (Utility.test_max_width(660)) { // Do the default behavior (navigate to image) - return false; + return; } var $image = $("#image"); @@ -335,7 +335,7 @@ Post.view_large = function(e) { }); Note.Box.scale_all(); $("body").attr("data-post-current-image-size", "large"); - return false; + e?.preventDefault(); } Post.toggle_fit_window = function(e) {