- $(".show-data", this).click(function() {
- imageId = $(this).closest(".image").find(".image-id").text();
- editImage(imageId);
+ imageId = $(this).closest(".image").find(".image-id").text();
+ (function(element, imageId) {
+ $(".show-data", element).click(function() {
+ editImage(imageId);
+ });
+ })(this, imageId);