Skip to content

Commit 4ba1f1a

Browse files
cslzchenfelliott
authored andcommitted
Set the background of the zoom image to "white"
Both the zoom image and the normal one underneath it are visible if it has a transparent backgournd. This bug only affects non-exported types: .GIF and .ICO. For exported ones, the export type .JPEG does not have transparency so the background is set to white by default. This fix simply applies such background when the zoom image's style class is generated on the page.
1 parent ead3389 commit 4ba1f1a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

mfr/extensions/image/static/js/jquery.zoom.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
* Original Copy: https://github.com/jackmoore/zoom/blob/1.7.20/jquery.zoom.js
55
* Version: https://github.com/jackmoore/zoom/releases/tag/1.7.20
66
*
7-
* The are two MFR customizations in this file, one for style and one for functionality
7+
* The are three MFR customizations in this file, two for style and one for functionality
88
*
99
* 1. Updated code style according to `.eslintrc.js`
1010
* 2. Added `.on("mousewheel", function (e) { ... })` to enable further zoom by mouse wheel scroll
11+
* 3. Set "background-color: white" for "zoomImage" to handle images with transparent background
1112
*/
1213

1314
(function ($) {
@@ -53,6 +54,7 @@
5354
top: 0,
5455
left: 0,
5556
opacity: 0,
57+
"background-color": "white",
5658
width: img.width * magnify,
5759
height: img.height * magnify,
5860
border: "none",

0 commit comments

Comments
 (0)