Skip to content

Commit

Permalink
Updated callback to include reference to new container
Browse files Browse the repository at this point in the history
The callback becomes more useful by passing the new container to the callback function as the primary argument
  • Loading branch information
homestar9 authored Jul 28, 2019
1 parent 323c51c commit 5a55c61
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions jquery-repeater.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var Repeater = new Class({
removeSelector: '.repeater-remove',
withDataAndEvents: false,
deepWithDataAndEvents: false,
addCallback: function(){},
addCallback: function( newContainer ){},
wrapperHtml: "<div class='repeater-wrap'></div>"
},
i: 0,
Expand Down Expand Up @@ -48,7 +48,7 @@ var Repeater = new Class({
this.incrementContainerAttributes(newContainer);
this.initContainerButtons(newContainer);
$(newContainer).appendTo(this.wrapper);
this.options.addCallback();
this.options.addCallback( newContainer );
this.i++;
},

Expand Down Expand Up @@ -88,4 +88,4 @@ var Repeater = new Class({
}


});
});

0 comments on commit 5a55c61

Please sign in to comment.