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")) {