Browse Source

Merge pull request #132 from mrcoles/master

bugfix clicking on diff image and dataURI
pull/134/head
James Cryer 7 years ago committed by GitHub
parent
commit
a242d32a31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 18
      demoassets/main.js

18
demoassets/main.js

@ -60,7 +60,23 @@ $(function(){
$('#image-diff').html(diffImage); $('#image-diff').html(diffImage);
$(diffImage).click(function(){ $(diffImage).click(function(){
window.open(diffImage.src, '_blank'); var w = window.open("about:blank", "_blank");
var html = w.document.documentElement;
var body = w.document.body;
html.style.margin = 0;
html.style.padding = 0;
body.style.margin = 0;
body.style.padding = 0;
var img = w.document.createElement("img");
img.src = diffImage.src;
img.alt = "image diff";
img.style.maxWidth = "100%";
img.addEventListener("click", function() {
this.style.maxWidth = this.style.maxWidth === "100%" ? "" : "100%";
});
body.appendChild(img);
}); });
$('.buttons').show(); $('.buttons').show();

Loading…
Cancel
Save