Skip to content

Commit

Permalink
added img preview
Browse files Browse the repository at this point in the history
  • Loading branch information
Sidney Maestre committed Jan 4, 2013
1 parent 99e1a3e commit 5ef745b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions index.html
Expand Up @@ -388,18 +388,19 @@
this.render();
},

saveImage: function() {
saveImage: function(ev) {
console.log("save image");

var reader = new FileReader();
reader.onload = (function(ev) {
console.log("loaded image");
$(".latest img").attr("src", ev.target.result).fadeIn();
});

var file = this.files[0];
$(".latest img").data("name", file.name);
reader.readAsDataURL(file);

console.log("done image");
},

render: function() {
Expand Down

0 comments on commit 5ef745b

Please sign in to comment.