mdelrosso / sheepit

SheepIt! Form Cloning plugin for Jquery
http://www.mdelrosso.com/sheepit/
MIT License
68 stars 44 forks source link

afterRemove called when not removed #18

Open sgbeal opened 11 years ago

sgbeal commented 11 years ago

the afteRemove callback is, quite non-intuitively, called even if the users denies removal via confirm(), and the callback provides no way of telling the client whether or not the element was REALLY removed. This makes it impossible to, e.g., post an AJAX delete-resource request based on the afterRemove callbacking being called (which is what we are trying to do).

To work around this we locally hacked the afterRemove-calling code to pass a second parameter, a boolean telling us whether or not the remove actually happened. This is, however, IMO, not a real solution. IMO the afterRemove should not be called unless something is actually removed.