(($) -> $.HandleNesting = (el, options) -> base = this base.$el = $(el) base.el = el base.items = [] base.blank = null base.$el.data "HandleNesting", base base.init = -> base.options = $.extend({}, $.HandleNesting.defaultOptions, options) base.items = base.$el.children("li") base.blank = $(base.items[base.items.length - 1]).clone() if base.items.length base.addButtons() base.addButtons = -> base.addAddButton() base.items.each (i, item) -> base.addRemoveButton item base.addAddButton = -> addButton = $("