ryanb/nested_form — pull request #183 by clemens (2012-07-26 15:59:20+00:00)
Title: Fix: Element.up() is the proper Prototype counter part to jQuery's closest()

The existing code uses Element.getOffsetParent() in one place and Element.ancestors()[0] in another place to mimic jQuery's closest() function to get the wrapper with class fields. This pull request replaces both occurrences with Element.up('.fields') which, for this purpose, works like jQuery's closest() function (also see http://stackoverflow.com/questions/2366367/prototype-equivalent-for-jquery-closest-function).

This is needed especially when have additional markup where the link/button to remove the nested fields isn't a direct child of the wrapper.