Update app/assets/javascripts/cocoon.js

".live()" method replaced by ".on()" (jQuery 1.7+) method

on jQuery 1.7 .live() method is deprecated
on jQuery 1.9 .live() method is removed
This commit is contained in:
Ahmet Özkaya 2013-01-19 23:48:02 +02:00
parent b40e73734c
commit 33f5df9d4c
1 changed files with 2 additions and 2 deletions

View File

@ -8,7 +8,7 @@
}
$('.add_fields').live('click', function(e) {
$(document).on('click', '.add_fields', function(e) {
e.preventDefault();
var $this = $(this),
assoc = $this.data('association'),
@ -55,7 +55,7 @@
});
$('.remove_fields.dynamic, .remove_fields.existing').live('click', function(e) {
$(document).on('click', '.remove_fields.dynamic, .remove_fields.existing', function(e) {
var $this = $(this);
var node_to_delete = $this.closest(".nested-fields");
var trigger_node = node_to_delete.parent();