comments and linting

pull/1176/head
aniket-engg 4 years ago committed by Aniket
parent 053d55c426
commit 3e564b489a
  1. 16
      apps/remix-ide/src/app/tabs/test-tab.js

@ -550,13 +550,15 @@ module.exports = class TestTab extends ViewPlugin {
} }
updateDirList (keycode = 'none') { updateDirList (keycode = 'none') {
// Initial load
if (keycode === 'none') { if (keycode === 'none') {
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 {
const presentOptions = this.uiPathList.querySelectorAll('option') const presentOptions = this.uiPathList.querySelectorAll('option')
if(keycode === 191) { // if '/' is pressed
if (keycode === 191) {
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>`))
@ -564,13 +566,13 @@ module.exports = class TestTab extends ViewPlugin {
} else { } else {
let matchFound = false let matchFound = false
for (var option of presentOptions) { for (var option of presentOptions) {
if (option.innerHTML.startsWith(this.inputPath.value)) if (option.innerHTML.startsWith(this.inputPath.value)) { matchFound = true }
matchFound = true
} }
if(!matchFound) this.createTestFolder.disabled = false // If there is no matching folder in the workspace with entered text, enable create button
if (!matchFound) this.createTestFolder.disabled = false
} }
} }
/* /*
It is not possible anymore to see folder from outside of the current workspace It is not possible anymore to see folder from outside of the current workspace
if (this.inputPath.value) { if (this.inputPath.value) {
@ -603,9 +605,9 @@ module.exports = class TestTab extends ViewPlugin {
data-id="testTabGenerateTestFolder" data-id="testTabGenerateTestFolder"
title="Create a test folder" title="Create a test folder"
disabled=true disabled=true
onclick=${(e) => { onclick=${(e) => {
this.testTabLogic.generateTestFolder(this.inputPath.value) this.testTabLogic.generateTestFolder(this.inputPath.value)
this.createTestFolder.disabled = true this.createTestFolder.disabled = true
}}> }}>
Create Create
</button>` </button>`

Loading…
Cancel
Save