Merge pull request #3826 from consul/jquery3_compatibility
Update deprecated jQuery syntax
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
$(document).bind("page:change", function() {
|
||||
$(document).on("page:change", function() {
|
||||
if (typeof(CKEDITOR) != "undefined"){
|
||||
for(name in CKEDITOR.instances){
|
||||
try{CKEDITOR.replace(name);}catch(err){};
|
||||
|
||||
@@ -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) {
|
||||
@@ -54,7 +54,7 @@
|
||||
}
|
||||
}
|
||||
});
|
||||
$("[name='progress_bar[kind]']").change();
|
||||
$("[name='progress_bar[kind]']").trigger("change");
|
||||
},
|
||||
initialize: function() {
|
||||
App.Forms.disableEnter();
|
||||
|
||||
@@ -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()));
|
||||
|
||||
@@ -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() {
|
||||
App.ValuationBudgetInvestmentForm.showAllFields();
|
||||
App.ValuationBudgetInvestmentForm.showFeasibilityFields();
|
||||
});
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user