Skip to content
This repository was archived by the owner on Dec 12, 2021. It is now read-only.

Commit f674457

Browse files
fxposterlest
authored andcommitted
Refactored jQuery code
Now jQuery does not wait until document:ready to apply event handlers. This is possible because we use live events and it requires only document object to be loaded.
1 parent f591c0d commit f674457

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

vendor/assets/javascripts/jquery_nested_form.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
jQuery(function($) {
1+
(function($) {
22
window.NestedFormEvents = function() {
33
this.addFields = $.proxy(this.addFields, this);
44
this.removeFields = $.proxy(this.removeFields, this);
@@ -76,7 +76,7 @@ jQuery(function($) {
7676
$(document)
7777
.delegate('form a.add_nested_fields', 'click', nestedFormEvents.addFields)
7878
.delegate('form a.remove_nested_fields', 'click', nestedFormEvents.removeFields);
79-
});
79+
})(jQuery);
8080

8181
// http://plugins.jquery.com/project/closestChild
8282
/*

0 commit comments

Comments
 (0)