This repository has been archived by the owner on Sep 11, 2020. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Not that anyone asked for it to my knowledge, but this is a handy option that I'm using on my server.
The signature of
Image.deleteFile
changed to take the jQuery element, instead of src. It now checks if yourdeleteScript
option is a function, and if so passes the element to the callback allowing the end developer to get whatever info they need from the element and make their own AJAX call, if they desire.The other delete options are ignored in this case, and it is up to the end developer to handle their AJAX options.
Use case: I'm using an API to handle my images that requires making a request like
DELETE /api/v1/image/42
, where42
is the image's unique id. This is very difficult to do under the current structure. This modification allows you tons of freedom when deleting. If you want to use the old behavior, your code need not change.I have never worked on a JS project, please be gentle.