Update deprecated jQuery syntax

These methods had already been superseeded by other methods since jQuery
1.7 or 1.8, and jQuery 3.0 will deprecate them.
This commit is contained in:
Javi Martín
2019-11-07 15:32:20 +01:00
parent 52d165b419
commit 953fc7ddb0
4 changed files with 6 additions and 6 deletions

View File

@@ -1,4 +1,4 @@
$(document).bind("page:change", function() { $(document).on("page:change", function() {
if (typeof(CKEDITOR) != "undefined"){ if (typeof(CKEDITOR) != "undefined"){
for(name in CKEDITOR.instances){ for(name in CKEDITOR.instances){
try{CKEDITOR.replace(name);}catch(err){}; try{CKEDITOR.replace(name);}catch(err){};

View File

@@ -9,13 +9,13 @@
}); });
}, },
submitOnChange: function() { submitOnChange: function() {
$(".js-submit-on-change").unbind("change").on("change", function() { $(".js-submit-on-change").off("change").on("change", function() {
$(this).closest("form").submit(); $(this).closest("form").submit();
return false; return false;
}); });
}, },
toggleLink: function() { toggleLink: function() {
$(".js-toggle-link").unbind("click").on("click", function() { $(".js-toggle-link").off("click").on("click", function() {
var toggle_txt; var toggle_txt;
$($(this).data("toggle-selector")).toggle("down"); $($(this).data("toggle-selector")).toggle("down");
if ($(this).data("toggle-text") !== undefined) { if ($(this).data("toggle-text") !== undefined) {
@@ -54,7 +54,7 @@
} }
} }
}); });
$("[name='progress_bar[kind]']").change(); $("[name='progress_bar[kind]']").trigger("change");
}, },
initialize: function() { initialize: function() {
App.Forms.disableEnter(); App.Forms.disableEnter();

View File

@@ -17,7 +17,7 @@
}; };
}, },
initialize: function() { initialize: function() {
$("table.sortable th").click(function() { $("table.sortable th").on("click", function() {
var rows, table; var rows, table;
table = $(this).parents("table").eq(0); table = $(this).parents("table").eq(0);
rows = table.find("tbody tr").toArray().sort(App.TableSortable.comparer($(this).index())); rows = table.find("tbody tr").toArray().sort(App.TableSortable.comparer($(this).index()));

View File

@@ -23,7 +23,7 @@
} }
}, },
showFeasibilityFieldsOnChange: function() { showFeasibilityFieldsOnChange: function() {
$("#valuation_budget_investment_edit_form input[type=radio][name='budget_investment[feasibility]']").change(function() { $("#valuation_budget_investment_edit_form input[type=radio][name='budget_investment[feasibility]']").on("change", function() {
App.ValuationBudgetInvestmentForm.showAllFields(); App.ValuationBudgetInvestmentForm.showAllFields();
App.ValuationBudgetInvestmentForm.showFeasibilityFields(); App.ValuationBudgetInvestmentForm.showFeasibilityFields();
}); });