Clean up code

This commit is contained in:
Chocobo1
2021-03-31 00:10:52 +08:00
parent f8067aa592
commit 8a087a876e
4 changed files with 28 additions and 33 deletions

View File

@@ -1283,7 +1283,7 @@
};
// Downloads tab
const WatchedFoldersTable = new HtmlTable($("watched_folders_tab"));
const watchedFoldersTable = new HtmlTable($("watched_folders_tab"));
const updateTempDirEnabled = function() {
const isTempDirEnabled = $('temppath_checkbox').getProperty('checked');
@@ -1334,7 +1334,7 @@
+ "</select>"
+ "<input id='cb_watch_txt_" + pos + "' type='text' " + (disableInput ? "hidden " : "") + "/></div>";
WatchedFoldersTable.push([myinput, mycb]);
watchedFoldersTable.push([myinput, mycb]);
$('cb_watch_' + pos).setProperty('value', sel);
if (disableInput) {
const elt = $('cb_watch_' + pos);
@@ -1349,14 +1349,14 @@
for (let i = 0; i < nb_folders; ++i) {
const fpath = $('text_watch_' + i).getProperty('value').trim();
if (fpath.length > 0) {
let other;
const sel = $('cb_watch_' + i).getProperty('value').trim();
if (sel == "other") {
let other;
if (sel == "other")
other = $('cb_watch_txt_' + i).getProperty('value').trim();
}
else {
other = (sel == "watch_folder") ? 0 : 1;
}
else
other = (sel === "watch_folder") ? 0 : 1;
folders.set(fpath, other);
}
}