Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update deprecated jQuery syntax #3826

Merged
merged 3 commits into from
Nov 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/assets/javascripts/ckeditor/reinit.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$(document).bind("page:change", function() {
$(document).on("page:change", function() {
javierm marked this conversation as resolved.
Show resolved Hide resolved
if (typeof(CKEDITOR) != "undefined"){
for(name in CKEDITOR.instances){
try{CKEDITOR.replace(name);}catch(err){};
Expand Down
6 changes: 3 additions & 3 deletions app/assets/javascripts/forms.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
});
},
submitOnChange: function() {
$(".js-submit-on-change").unbind("change").on("change", function() {
$(".js-submit-on-change").off("change").on("change", function() {
$(this).closest("form").submit();
return false;
});
},
toggleLink: function() {
$(".js-toggle-link").unbind("click").on("click", function() {
$(".js-toggle-link").off("click").on("click", function() {
var toggle_txt;
$($(this).data("toggle-selector")).toggle("down");
if ($(this).data("toggle-text") !== undefined) {
Expand Down Expand Up @@ -54,7 +54,7 @@
}
}
});
$("[name='progress_bar[kind]']").change();
$("[name='progress_bar[kind]']").trigger("change");
},
initialize: function() {
App.Forms.disableEnter();
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/table_sortable.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
};
},
initialize: function() {
$("table.sortable th").click(function() {
$("table.sortable th").on("click", function() {
var rows, table;
table = $(this).parents("table").eq(0);
rows = table.find("tbody tr").toArray().sort(App.TableSortable.comparer($(this).index()));
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/valuation_budget_investment_form.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
}
},
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() {
javierm marked this conversation as resolved.
Show resolved Hide resolved
App.ValuationBudgetInvestmentForm.showAllFields();
App.ValuationBudgetInvestmentForm.showFeasibilityFields();
});
Expand Down
9 changes: 1 addition & 8 deletions spec/shared/features/nested_documentable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -316,14 +316,7 @@ def documentable_attach_new_file(path, success = true)

document = all("#new_document").last
document_input = document.find("input[type=file]", visible: false)
page.execute_script("$('##{document_input[:id]}').css('display','block')")
attach_file(document_input[:id], path, visible: true)
page.execute_script("$('##{document_input[:id]}').css('display','none')")
# Poltergeist is not removing this attribute after file upload at
# https://github.com/teampoltergeist/poltergeist/blob/master/lib/capybara/poltergeist/client/browser.coffee#L187
# making https://github.com/teampoltergeist/poltergeist/blob/master/lib/capybara/poltergeist/client/browser.coffee#L186
# always choose the previous used input.
page.execute_script("$('##{document_input[:id]}').removeAttr('_poltergeist_selected')")
attach_file(document_input[:id], path, make_visible: true)

within document do
if success
Expand Down