Commit d330b6ff authored by aniket-engg's avatar aniket-engg Committed by Aniket

load dir list according to input value

parent 349ffd29
...@@ -552,12 +552,18 @@ module.exports = class TestTab extends ViewPlugin { ...@@ -552,12 +552,18 @@ module.exports = class TestTab extends ViewPlugin {
updateDirList (keycode = 'none') { updateDirList (keycode = 'none') {
const presentOptions = this.uiPathList.querySelectorAll('option') const presentOptions = this.uiPathList.querySelectorAll('option')
// Initial load // Initial load
if (keycode === 'none' || keycode === 191) { if (keycode === 'none' ) {
for (var o of presentOptions) o.remove() for (var o of presentOptions) o.remove()
this.testTabLogic.dirList('/').then((options) => { this.testTabLogic.dirList('/').then((options) => {
options.forEach((path) => this.uiPathList.appendChild(yo`<option>${path}</option>`)) options.forEach((path) => this.uiPathList.appendChild(yo`<option>${path}</option>`))
}) })
} else { } else if (this.inputPath.value && this.inputPath.value.endsWith('/')) {
for (var o of presentOptions) o.remove()
this.testTabLogic.dirList(this.inputPath.value).then((options) => {
options.forEach((path) => this.uiPathList.appendChild(yo`<option>${path}</option>`))
})
}
else {
let matchFound = false let matchFound = false
for (var option of presentOptions) { for (var option of presentOptions) {
if (option.innerHTML.startsWith(this.inputPath.value)) matchFound = true if (option.innerHTML.startsWith(this.inputPath.value)) matchFound = true
...@@ -612,7 +618,6 @@ module.exports = class TestTab extends ViewPlugin { ...@@ -612,7 +618,6 @@ module.exports = class TestTab extends ViewPlugin {
this.testTabLogic.generateTestFolder(this.inputPath.value) this.testTabLogic.generateTestFolder(this.inputPath.value)
this.createTestFolder.disabled = true this.createTestFolder.disabled = true
this.updateGenerateFileAction().disabled = false this.updateGenerateFileAction().disabled = false
this.updateDirList()
}}> }}>
Create Create
</button>` </button>`
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment