fake afnor

This commit is contained in:
2023-01-03 10:50:07 +01:00
parent e7f7a348da
commit e8f528574a
9 changed files with 152 additions and 35 deletions

View File

@ -30,6 +30,17 @@ $(document).ready(function() {
$("#"+$(this).data("modalid")).modal("show");
});
$('.add-another-collection-widget').click(function (e) {
var list = $($(this).attr('data-list-selector'));
var counter = list.data('widget-counter') || list.children().length;
var newWidget = list.attr('data-prototype');
newWidget = newWidget.replace(/__name__/g, counter);
counter++;
list.data('widget-counter', counter);
var newElem = $(list.attr('data-widget-tags')).html(newWidget);
newElem.appendTo(list);
});
// Resize
resize();