From fa17c51a7bf233fb9760130f378e846bd5ac7998 Mon Sep 17 00:00:00 2001 From: Gaudenz Steinlin Date: Fri, 14 Mar 2014 16:51:57 +0100 Subject: [PATCH] Replace $.live with $.on This is needed for jQuery >= 1.9 compatibility and is compatible with JQuery >= 1.7 (Plone 4.3 onwards). --- CHANGES.rst | 4 ++++ plone/app/discussion/browser/javascripts/comments.js | 4 ++-- plone/app/discussion/browser/javascripts/controlpanel.js | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 687bbe0..bc28a4d 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -10,6 +10,10 @@ Changelog - Trigger custom events on comment add/remove/reply [avoinea] +- Replace $.live with $.on for jQuery >= 1.9 compatibility. This works on + jQuery >= 1.7 (Plone 4.3 onwards). + [gaudenz] + 2.3.2 (2014-04-05) ------------------ diff --git a/plone/app/discussion/browser/javascripts/comments.js b/plone/app/discussion/browser/javascripts/comments.js index 85f2e96..4da5af5 100644 --- a/plone/app/discussion/browser/javascripts/comments.js +++ b/plone/app/discussion/browser/javascripts/comments.js @@ -143,7 +143,7 @@ /********************************************************************** * Publish a single comment. **********************************************************************/ - $("input[name='form.button.PublishComment']").live('click', function () { + $("input[name='form.button.PublishComment']").on('click', function () { var trigger = this; var form = $(this).parents("form"); var data = $(form).serialize(); @@ -169,7 +169,7 @@ /********************************************************************** * Delete a comment and its answers. **********************************************************************/ - $("input[name='form.button.DeleteComment']").live('click', function () { + $("input[name='form.button.DeleteComment']").on('click', function () { var trigger = this; var form = $(this).parents("form"); var data = $(form).serialize(); diff --git a/plone/app/discussion/browser/javascripts/controlpanel.js b/plone/app/discussion/browser/javascripts/controlpanel.js index ba32492..f821bf9 100644 --- a/plone/app/discussion/browser/javascripts/controlpanel.js +++ b/plone/app/discussion/browser/javascripts/controlpanel.js @@ -100,7 +100,7 @@ $.updateSettings(); // Set #content class and update settings afterwards - $("input,select").live("change", function (e) { + $("input,select").on("change", function (e) { var id = $(this).attr("id"); if (id === "form-widgets-globally_enabled-0") { if ($(this).attr("checked")) {