Browse Source

Set property instead of set attribute

This commit resolves an issue with Safari not properly selecting an `<option>`.

Closes #17866.
PR #19024.
adaptive-webui-19844
Jimmy Axenhus 1 year ago committed by GitHub
parent
commit
c4ed40b82f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      src/webui/www/private/scripts/prop-files.js
  2. 4
      src/webui/www/private/views/log.html
  3. 8
      src/webui/www/private/views/preferences.html

6
src/webui/www/private/scripts/prop-files.js

@ -173,7 +173,7 @@ window.qBittorrent.PropFiles = (function() { @@ -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() { @@ -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;

4
src/webui/www/private/views/log.html

@ -191,10 +191,10 @@ @@ -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;
}
});

8
src/webui/www/private/views/preferences.html

@ -1887,7 +1887,7 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD @@ -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 @@ -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 @@ -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 @@ -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

Loading…
Cancel
Save