diff --git a/src/webui/www/private/scripts/prop-files.js b/src/webui/www/private/scripts/prop-files.js index 503350f90..19ae1c6bc 100644 --- a/src/webui/www/private/scripts/prop-files.js +++ b/src/webui/www/private/scripts/prop-files.js @@ -173,7 +173,7 @@ window.qBittorrent.PropFiles = (function() { elem.set('value', priority.toString()); elem.set('html', html); if (selected) - elem.setAttribute('selected', ''); + elem.selected = true; return elem; }; @@ -210,9 +210,9 @@ window.qBittorrent.PropFiles = (function() { for (let i = 0; i < options.length; ++i) { const option = options[i]; if (parseInt(option.value) === priority) - option.setAttribute('selected', ''); + option.selected = true; else - option.removeAttribute('selected'); + option.selected = false; } combobox.value = priority; diff --git a/src/webui/www/private/views/log.html b/src/webui/www/private/views/log.html index 469987231..cdd78d99c 100644 --- a/src/webui/www/private/views/log.html +++ b/src/webui/www/private/views/log.html @@ -191,10 +191,10 @@ const init = () => { $('logLevelSelect').getElements('option').each((x) => { if (selectedLogLevels.indexOf(x.value.toString()) !== -1) { - x.setAttribute('selected', ''); + x.selected = true; } else { - x.removeAttribute('selected'); + x.selected = false; } }); diff --git a/src/webui/www/private/views/preferences.html b/src/webui/www/private/views/preferences.html index e53a0bd8c..1eb726e21 100644 --- a/src/webui/www/private/views/preferences.html +++ b/src/webui/www/private/views/preferences.html @@ -1887,7 +1887,7 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD index = 2; break; } - $('contentlayout_select').getChildren('option')[index].setAttribute('selected', ''); + $('contentlayout_select').getChildren('option')[index].selected = true; $('addToTopOfQueueCheckbox').setProperty('checked', pref.add_to_top_of_queue); $('dontstartdownloads_checkbox').setProperty('checked', pref.start_paused_enabled); switch (pref.torrent_stop_condition) { @@ -1901,7 +1901,7 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD index = 2; break; } - $('stopConditionSelect').getChildren('option')[index].setAttribute('selected', ''); + $('stopConditionSelect').getChildren('option')[index].selected = true; $('deletetorrentfileafter_checkbox').setProperty('checked', pref.auto_delete_mode); $('preallocateall_checkbox').setProperty('checked', pref.preallocate_all); @@ -2072,7 +2072,7 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD $('pex_checkbox').setProperty('checked', pref.pex); $('lsd_checkbox').setProperty('checked', pref.lsd); const encryption = pref.encryption.toInt(); - $('encryption_select').getChildren('option')[encryption].setAttribute('selected', ''); + $('encryption_select').getChildren('option')[encryption].selected = true; $('anonymous_mode_checkbox').setProperty('checked', pref.anonymous_mode); $('maxActiveCheckingTorrents').setProperty('value', pref.max_active_checking_torrents); @@ -2111,7 +2111,7 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD maxRatioAct = 2; break; } - $('max_ratio_act').getChildren('option')[maxRatioAct].setAttribute('selected', ''); + $('max_ratio_act').getChildren('option')[maxRatioAct].selected = true; updateMaxRatioTimeEnabled(); // Add trackers