Fix "Create subfolder" option is not working in WebUI

Closes #10392.
This commit is contained in:
Chocobo1 2019-05-01 11:46:46 +08:00
parent 2d7b833ae6
commit 8aa8b19f37
No known key found for this signature in database
GPG key ID: 210D9C873253A68C
3 changed files with 31 additions and 30 deletions

View file

@ -55,19 +55,20 @@ var getPreferences = function() {
alert("Could not contact qBittorrent");
},
onSuccess: function(pref) {
if (pref) {
defaultSavePath = pref.save_path;
$('savepath').setProperty('value', defaultSavePath);
$('root_folder').checked = pref.create_subfolder_enabled;
$('start_torrent').checked = !pref.start_paused_enabled;
if (!pref)
return;
if (pref.auto_tmm_enabled == 1) {
$('autoTMM').selectedIndex = 1;
$('savepath').disabled = true;
}
else {
$('autoTMM').selectedIndex = 0;
}
defaultSavePath = pref.save_path;
$('savepath').setProperty('value', defaultSavePath);
$('rootFolder').checked = pref.create_subfolder_enabled;
$('startTorrent').checked = !pref.start_paused_enabled;
if (pref.auto_tmm_enabled == 1) {
$('autoTMM').selectedIndex = 1;
$('savepath').disabled = true;
}
else {
$('autoTMM').selectedIndex = 0;
}
}
}).send();