Skip to content

Commit

Permalink
remember to copy the class list over when replacing the image
Browse files Browse the repository at this point in the history
  • Loading branch information
thedustinsmith committed Feb 5, 2018
1 parent 71f637d commit 12ab62e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion croppie.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@
function loadImage(src, doExif) {
var img = new Image();
img.style.opacity = 0;

return new Promise(function (resolve) {
function _resolve() {
img.style.opacity = 1;
Expand Down Expand Up @@ -1224,6 +1223,7 @@

function _replaceImage(img) {
if (this.elements.img.parentNode) {
Array.prototype.forEach.call(this.elements.img.classList, function(c) { img.classList.add(c); });
this.elements.img.parentNode.replaceChild(img, this.elements.img);
this.elements.preview = img; // if the img is attached to the DOM, they're not using the canvas
}
Expand Down

0 comments on commit 12ab62e

Please sign in to comment.