Commit Graph

16 Commits

Author SHA1 Message Date
nathanvda
bbba9dc4c0 Add the (to be) inserted or (to be) removed html to the event.
The event gets an extra parameter: for `before-insert` and `after-insert` the inserted piece of html. For `before-remove` and `after-remove` the removed piece of html. This way one can add effects/animations if needed.

The remove code has been refactored (less code duplication), and checks for a possible timeout, which can be set in the `before-remove` callback.
2012-10-18 07:28:29 +02:00
nathanvda
8118a45953 Make sure we handle self-nested forms correctly. Fixes #96 and #74. 2012-10-13 00:11:16 +02:00
Nikolay Seskin
646c036258 Update app/assets/javascripts/cocoon.js 2012-10-12 17:54:55 +04:00
Nathan Van der Auwera
a5cc3212a7 Rename the events: use clear collision-free names. 2012-09-25 00:03:20 +02:00
Dmytrii Nagirniak
d4b997a082 Fix broken js at c69c157aff 2012-09-24 19:00:19 +10:00
Nathan Van der Auwera
c69c157aff Renamed the triggered events to be more clear and symmetric, and added a before-insert. As discussed in #89. 2012-09-21 00:38:26 +02:00
Nathan Van der Auwera
c2a0be513d Merge pull request #83 from porecreat/rename-template
Rename link 'template' data attribute
2012-09-13 05:17:55 -07:00
Gauthier Delacroix
9e3f0436d1 Rename JS 'template' data 2012-08-29 10:33:40 +02:00
Gauthier Delacroix
3833d9b175 Add relative node selection 2012-08-28 19:08:57 +02:00
Bart Duchesne
a8e0a64ff0 call insertion-callback on the correct node (in case a specific insertion-node is specified) 2012-07-30 10:49:17 +02:00
nathanvda
5047cdf0f1 Pulled in the changes from erwin (pull #51)., with a few changes to clean up and maintain backwards compatibility. 2012-04-07 01:33:30 +02:00
Matte Edens
4563b685be add data-association-insertion-method
the -position data attribute doesn't really "make sense" when adding
the "append" or "prepend" methods. those aren't "positions".  I try to
be grammatically correct. :)
2011-12-06 12:03:25 -08:00
nathanvda
c278916ad4 Added new callback solution, allowing both insertion and removal callbacks. 2011-10-12 23:00:20 +02:00
gray
7821a6bb8f Use safe jQuery & remove document ready 2011-09-26 12:01:20 +03:00
Carlos Segura
9dfedb4733 Add option to use this in association-insertion-node 2011-08-25 00:57:20 +02:00
nathanvda
1628bb19d3 Made Cocoon Rails 3.1 compatible:
- moved cocoon.js to app/assets/javascripts
- adapted install-generator accordingly (for rails 3.0.x)
- made it an engine instead of railtie (to use the asset pipeline)
2011-07-24 00:17:40 +02:00