N°3657 - Replace calls to deprecate jQuery methods (".click(callback)" to ".on('click', callback)")

This commit is contained in:
Molkobain
2021-03-15 09:29:09 +01:00
parent e143fa5e33
commit 370c08cd68
30 changed files with 61 additions and 62 deletions

View File

@@ -143,7 +143,7 @@ class SetupPage extends NiceWebPage
$this->p("<li>$sItem</li>\n");
}
$this->p('</ul>');
$this->add_ready_script("$('#{$sId}').click( function() { $(this).toggleClass('open'); $('#{$sId}_list').toggle();} );\n");
$this->add_ready_script("$('#{$sId}').on('click', function() { $(this).toggleClass('open'); $('#{$sId}_list').toggle();} );\n");
if (!$bOpen)
{
$this->add_ready_script("$('#{$sId}').toggleClass('open'); $('#{$sId}_list').toggle();\n");

View File

@@ -1089,11 +1089,11 @@ JS
}
$oPage->add_ready_script(
<<<'JS'
$("tbody.collapsable-options>tr>th>label").click(function() {
$("tbody.collapsable-options>tr>th>label").on('click', function() {
var $tbody = $(this).closest("tbody");
toggleCollapsableOptions($tbody);
});
$("#db_tls_enabled").click(function() {
$("#db_tls_enabled").on('click', function() {
var bTlsEnabled = $("#db_tls_enabled").is(":checked");
$("#db_tls_ca").prop("disabled", !bTlsEnabled);
});

View File

@@ -229,7 +229,7 @@ $('form').each(function () {
width: 0
}));
});
$('#btn_back').click(function() { $('#wiz_form').data('back', true); });
$('#btn_back').on('click', function() { $('#wiz_form').data('back', true); });
$('#wiz_form').on('submit', function() {
if ($(this).data('back'))

View File

@@ -633,7 +633,7 @@ HTML
$oPage->add_ready_script(
<<<EOF
$("#changes_summary .title").click(function() { $(this).parent().toggleClass('closed'); } );
$("#changes_summary .title").on('click', function() { $(this).parent().toggleClass('closed'); } );
$('input[name=upgrade_type]').bind('click change', function() { WizardUpdateButtons(); });
EOF
);
@@ -726,7 +726,7 @@ EOF
$oPage->add('<li><b>'.$oLicense->product.'</b>, &copy; '.$oLicense->author.' is licensed under the <b>'.$oLicense->license_type.' license</b>. (<span class="toggle" id="toggle_'.$index.'">Details</span>)');
$oPage->add('<div id="license_'.$index.'" class="license_text" style="display:none;overflow:auto;max-height:10em;font-size:small;border:1px #696969 solid;margin-bottom:1em; margin-top:0.5em;padding:0.5em;">'.$oLicense->text.'</div>');
$oPage->add_ready_script('$(".license_text a").attr("target", "_blank").addClass("no-arrow");');
$oPage->add_ready_script('$("#toggle_'.$index.'").click( function() { $("#license_'.$index.'").toggle(); } );');
$oPage->add_ready_script('$("#toggle_'.$index.'").on('click', function() { $("#license_'.$index.'").toggle(); } );');
$index++;
}
$oPage->add('</ul>');
@@ -1012,7 +1012,7 @@ class WizStepMiscParams extends WizardStep
<<<EOF
$('#application_url').bind('change keyup', function() { WizardUpdateButtons(); } );
$('#graphviz_path').bind('change keyup init', function() { WizardUpdateButtons(); WizardAsyncAction('check_graphviz', { graphviz_path: $('#graphviz_path').val(), authent: $('#authent_token').val()}); } ).trigger('init');
$('#btn_next').click(function() {
$('#btn_next').on('click', function() {
bRet = true;
if ($(this).attr('data-graphviz') != 'ok')
{
@@ -1151,7 +1151,7 @@ class WizStepUpgradeMiscParams extends WizardStep
<<<EOF
$('#application_url').bind('change keyup', function() { WizardUpdateButtons(); } );
$('#graphviz_path').bind('change keyup init', function() { WizardUpdateButtons(); WizardAsyncAction('check_graphviz', { graphviz_path: $('#graphviz_path').val(), authent: $('#authent_token').val() }); } ).trigger('init');
$('#btn_next').click(function() {
$('#btn_next').on('click', function() {
bRet = true;
if ($(this).attr('data-graphviz') != 'ok')
{
@@ -2318,7 +2318,7 @@ CSS
$oPage->add_ready_script(
<<<JS
$("#params_summary div").addClass('closed');
$("#params_summary .title").click(function() { $(this).parent().toggleClass('closed'); } );
$("#params_summary .title").on('click', function() { $(this).parent().toggleClass('closed'); } );
$("#btn_next").bind("click.install", function(event) {
$('#summary').hide();
$('#installation_progress').show();