From f1ffc016b8345348eb48a6a8a2f798f8f13d2e37 Mon Sep 17 00:00:00 2001 From: evazion Date: Fri, 27 Mar 2020 21:29:34 -0500 Subject: [PATCH] posts: fix tagged filenames disappearing after viewing original. The file url in the data attributes on the image container doesn't contain the tags for performance reasons. The post data attributes are used for thumbnails too and we don't want to include tagged filenames for those because it requires looking up tag categories, which triggers a lot of redis calls on the post index page. --- app/javascript/src/javascripts/posts.js.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/javascript/src/javascripts/posts.js.erb b/app/javascript/src/javascripts/posts.js.erb index a16825c6f..b7dd3e6b0 100644 --- a/app/javascript/src/javascripts/posts.js.erb +++ b/app/javascript/src/javascripts/posts.js.erb @@ -307,7 +307,7 @@ Post.view_original = function(e) { } var $image = $("#image"); - $image.attr("src", $(".image-container").data("file-url")); + $image.attr("src", $(".image-view-original-link").attr("href")); $image.css("filter", "blur(8px)"); $image.width($image.data("original-width")); $image.height($image.data("original-height")); @@ -326,7 +326,7 @@ Post.view_large = function(e) { } var $image = $("#image"); - $image.attr("src", $(".image-container").data("large-file-url")); + $image.attr("src", $(".image-view-large-link").attr("href")); $image.css("filter", "blur(8px)"); $image.width($image.data("large-width")); $image.height($image.data("large-height"));