From 1d8e370914b21bb16be45369af5b06ac9d818c79 Mon Sep 17 00:00:00 2001 From: WubzyGD Date: Tue, 19 Apr 2022 13:26:53 -0600 Subject: [PATCH] folder selection util --- scripts/fileview/selectfolder.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 scripts/fileview/selectfolder.js diff --git a/scripts/fileview/selectfolder.js b/scripts/fileview/selectfolder.js new file mode 100644 index 0000000..9d48bc3 --- /dev/null +++ b/scripts/fileview/selectfolder.js @@ -0,0 +1,12 @@ +module.exports = (name) => { + let folders = document.getElementById('files').getElementsByClassName('folder'); + let folder = 1; + for (let i = 0; i < folders.length; i++) { + if (folders.item(i).children.item(1).innerHTML === name) { + folder = folders.item(i); + folder.click(); + break; + } + } + return folder; +}; \ No newline at end of file