remove image.style.height on resize (#1856)

This commit is contained in:
BlueGreenMagick 2022-05-11 09:06:34 +09:00 committed by GitHub
parent ab1c23953e
commit fb5521eeed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -152,12 +152,13 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
} }
/** /**
* Image resizing add-ons previously used image.style.width to set the * Image resizing add-ons previously used image.style.width/height to set the
* preferred width of an image. In these cases, if we'd only set * preferred dimension of an image. In these cases, if we'd only set
* image.width, there would be no visible effect on the image. * image.[dimension], there would be no visible effect on the image.
* To avoid confusion with users we'll clear image.style.width (for now). * To avoid confusion with users we'll clear image.style.[dimension] (for now).
*/ */
activeImage!.style.removeProperty("width"); activeImage!.style.removeProperty("width");
activeImage!.style.removeProperty("height");
if (activeImage!.getAttribute("style")?.length === 0) { if (activeImage!.getAttribute("style")?.length === 0) {
activeImage!.removeAttribute("style"); activeImage!.removeAttribute("style");
} }