jQuery: avoid .removeAttr, prefer .prop

This commit is contained in:
webzwo0i 2021-07-06 17:39:56 +02:00 committed by SamTV12345
parent d5b981719f
commit a38db36aab
4 changed files with 6 additions and 6 deletions

View file

@ -164,7 +164,7 @@ $(document).ready(() => {
if (data.query.offset === 0) search.results = []; if (data.query.offset === 0) search.results = [];
search.messages.hide('nothing-found'); search.messages.hide('nothing-found');
search.messages.hide('fetching'); search.messages.hide('fetching');
$('#search-query').removeAttr('disabled'); $('#search-query').prop('disabled', false);
console.log('got search results', data); console.log('got search results', data);

View file

@ -38,7 +38,7 @@ const padimpexp = (() => {
const fileInputUpdated = () => { const fileInputUpdated = () => {
$('#importsubmitinput').addClass('throbbold'); $('#importsubmitinput').addClass('throbbold');
$('#importformfilediv').addClass('importformenabled'); $('#importformfilediv').addClass('importformenabled');
$('#importsubmitinput').removeAttr('disabled'); $('#importsubmitinput').prop('disabled', false);
$('#importmessagefail').fadeOut('fast'); $('#importmessagefail').fadeOut('fast');
}; };
@ -69,8 +69,8 @@ const padimpexp = (() => {
$('#import_export').removeClass('popup-show'); $('#import_export').removeClass('popup-show');
if (directDatabaseAccess) window.location.reload(); if (directDatabaseAccess) window.location.reload();
} }
$('#importsubmitinput').removeAttr('disabled').val(html10n.get('pad.impexp.importbutton')); $('#importsubmitinput').prop('disabled', false).val(html10n.get('pad.impexp.importbutton'));
window.setTimeout(() => $('#importfileinput').removeAttr('disabled'), 0); window.setTimeout(() => $('#importfileinput').prop('disabled', false), 0);
$('#importstatusball').hide(); $('#importstatusball').hide();
addImportFrames(); addImportFrames();
})(); })();

View file

@ -341,7 +341,7 @@ const paduserlist = (() => {
}, () => { }, () => {
jqueryNode.val(valueGetter()).trigger('blur'); jqueryNode.val(valueGetter()).trigger('blur');
}); });
jqueryNode.removeAttr('disabled').addClass('editable'); jqueryNode.prop('disabled', false).addClass('editable');
}; };
let pad = undefined; let pad = undefined;

View file

@ -313,7 +313,7 @@ const padutils = {
if (value) { if (value) {
$(node).attr('checked', 'checked'); $(node).attr('checked', 'checked');
} else { } else {
$(node).removeAttr('checked'); $(node).prop('checked', false);
} }
}, },
bindCheckboxChange: (node, func) => { bindCheckboxChange: (node, func) => {