From 33f5df9d4c377e1f98fc8fb2b951dd37918706e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20=C3=96zkaya?= Date: Sat, 19 Jan 2013 23:48:02 +0200 Subject: [PATCH] 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 --- app/assets/javascripts/cocoon.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/cocoon.js b/app/assets/javascripts/cocoon.js index b4ec934..951b959 100644 --- a/app/assets/javascripts/cocoon.js +++ b/app/assets/javascripts/cocoon.js @@ -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();