Inside of a loop (that loops through images) I have:
var crop = new lx.FileCrop(img);
This is a class that allows a user to crop images.
It gets the offset, width and height of a draggable box, creating a crop.
This data then needs to be sent off to the server for image processing.
I was just wondering what the best way to do this would be:
A) store the crop details on the image in a data attribute, then when the user clicks save, loop through and round these up.
B) Is there a way to get access to each FileCrop class later and do something like crop.getCrop()? If so how would I get access to each class later on?
I was also wondering, when I save the data, on success, I will remove the images from the screen. I'll do this by using jquery remove(). I was wondering what happens to all the FileCrop classes I made, will these need to be cleaned up? If so, how?