From 73a9f3c77baf8da7b3c371ecb4a461a8b088a027 Mon Sep 17 00:00:00 2001 From: emredokmetas Date: Fri, 6 Nov 2020 12:54:40 +0300 Subject: [PATCH] Update jquery.repeater.js --- jquery.repeater.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/jquery.repeater.js b/jquery.repeater.js index 1678b1f..2a196a5 100644 --- a/jquery.repeater.js +++ b/jquery.repeater.js @@ -994,7 +994,13 @@ $.fn.repeater = function (fig) { $items().remove(); foreach(rows, addItem); }; - + + restart = function () { + $list = $self.find('[data-repeater-list]').first() + $itemTemplate = $list.find('[data-repeater-item]') + .first().clone().hide(); + }; + $filterNested($self.find('[data-repeater-create]'), fig.repeaters).click(function () { addItem(); }); @@ -1009,8 +1015,9 @@ $.fn.repeater = function (fig) { }); this.setList = setList; + this.restart = restart; return this; }; -}(jQuery)); \ No newline at end of file +}(jQuery));