From 0b8645007fdf26aff728bdee208ddd1b233e62b8 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Sun, 14 Sep 2014 14:16:56 +0000 Subject: [PATCH] Backport r13315 from rails-4.1 to trunk. Use .on() instead of .live(). git-svn-id: http://svn.redmine.org/redmine/trunk@13407 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- public/javascripts/application.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/public/javascripts/application.js b/public/javascripts/application.js index fdf5c477b..03330c88a 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -81,13 +81,13 @@ function initFilters() { $('#filters-table td.field input[type=checkbox]').each(function() { toggleFilter($(this).val()); }); - $('#filters-table td.field input[type=checkbox]').live('click', function() { + $('#filters-table').on('click', 'td.field input[type=checkbox]', function() { toggleFilter($(this).val()); }); - $('#filters-table .toggle-multiselect').live('click', function() { + $('#filters-table').on('click', '.toggle-multiselect', function() { toggleMultiSelect($(this).siblings('select')); }); - $('#filters-table input[type=text]').live('keypress', function(e) { + $('#filters-table').on('keypress', 'input[type=text]', function(e) { if (e.keyCode == 13) submit_query_form("query_form"); }); } @@ -537,10 +537,10 @@ function initMyPageSortable(list, url) { var warnLeavingUnsavedMessage; function warnLeavingUnsaved(message) { warnLeavingUnsavedMessage = message; - $('form').live('submit', function(){ + $(document).on('submit', 'form', function(){ $('textarea').removeData('changed'); }); - $('textarea').live('change', function(){ + $(document).on('change', 'textarea', function(){ $(this).data('changed', 'changed'); }); window.onbeforeunload = function(){ -- 2.39.5