I add an image. It automatically uploads it, and sets the path in the front end listing object after the fileuploaddone event is triggered. When I click the "Finish" button in the photo editor, it attempts to save the listing. If I've added a photo, but the fileuploaddone event hasn't yet been triggered (because I click "Finish" right after adding it), it attempts to save the listing with an image that isn't complete (image_id is -1, and image_path is an empty string). This needs to make use of a jquery deferred object to make sure both of those events happen and in order, perhaps with a timeout that would signal that something went wrong, and we should abort.
I add an image. It automatically uploads it, and sets the path in the front end listing object after the fileuploaddone event is triggered. When I click the "Finish" button in the photo editor, it attempts to save the listing. If I've added a photo, but the fileuploaddone event hasn't yet been triggered (because I click "Finish" right after adding it), it attempts to save the listing with an image that isn't complete (image_id is -1, and image_path is an empty string). This needs to make use of a jquery deferred object to make sure both of those events happen and in order, perhaps with a timeout that would signal that something went wrong, and we should abort.