posts: remove data-* attributes from #image element.

These attributes can be found on the `.image-container` element instead.
This commit is contained in:
evazion
2020-07-31 15:16:01 -05:00
parent 3fe18c57d0
commit a8577b2b94
5 changed files with 11 additions and 21 deletions

View File

@@ -339,7 +339,6 @@ class Note {
// Rescale font sizes of embedded notes when the image is resized.
static scale_all() {
let $image = $("#image");
let $container = $(".note-container");
if ($container.length === 0) {
@@ -348,8 +347,8 @@ class Note {
Note.Body.hide_all();
let large_width = parseFloat($image.data('large-width'));
let ratio = $image.width() / large_width;
let large_width = parseFloat($container.data("large-width"));
let ratio = $container.width() / large_width;
let font_percentage = ratio * 100;
$container.css('font-size', font_percentage + '%');

View File

@@ -307,10 +307,11 @@ Post.view_original = function(e = null) {
}
var $image = $("#image");
var $post = $(".image-container");
$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"));
$image.width($post.data("width"));
$image.height($post.data("height"));
$image.on("load.danbooru", function() {
$image.css("animation", "sharpen 0.5s forwards");
});
@@ -326,10 +327,11 @@ Post.view_large = function(e = null) {
}
var $image = $("#image");
var $post = $(".image-container");
$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"));
$image.width($post.data("large-width"));
$image.height($post.data("large-height"));
$image.on("load.danbooru", function() {
$image.css("animation", "sharpen 0.5s forwards");
});