do not automatically create a folder

pull/933/head
yann300 4 years ago
parent c759cf7232
commit 6ae7edd7c1
  1. 3
      apps/remix-ide/src/app/tabs/styles/test-tab-styles.js
  2. 20
      apps/remix-ide/src/app/tabs/test-tab.js
  3. 3
      apps/remix-ide/src/app/tabs/testTab/testTab.js

@ -48,5 +48,8 @@ var css = csjs`
.labelOnBtn {
border: hidden;
}
.inputFolder {
width: 80%;
}
`
module.exports = css

@ -573,18 +573,28 @@ module.exports = class TestTab extends ViewPlugin {
this.inputPath = yo`<input
placeholder=${this.defaultPath}
list="utPathList"
class="custom-select"
class="${css.inputFolder} custom-select"
id="utPath"
data-id="uiPathInput"
name="utPath"
style="background-image: var(--primary);"
onkeydown=${(e) => { if (e.keyCode === 191) this.updateDirList() }}
onchange=${(e) => this.updateCurrentPath(e)}/>`
onkeydown=${(e) => { if (e.keyCode === 191) this.updateDirList() }}/>`
const createTestFolder = yo`<button
class="btn border ml-2"
data-id="testTabGenerateTestFolder"
title="Create a test folder"
onclick=${(e) => { this.testTabLogic.generateTestFolder(this.inputPath.value) }}>
Create
</button>`
const availablePaths = yo`
<div>
${this.inputPath}
${this.uiPathList}
<div class="d-flex p-2">
${this.inputPath}
${createTestFolder}
${this.uiPathList}
</div>
</div>
`
this.updateDirList()

@ -11,6 +11,9 @@ class TestTabLogic {
setCurrentPath (path) {
if (path.indexOf('/') === 0) return
this.currentPath = path
}
generateTestFolder (path) {
const fileProvider = this.fileManager.fileProviderOf(path.split('/')[0])
fileProvider.exists(path, (e, res) => { if (!res) fileProvider.createDir(path) })
}

Loading…
Cancel
Save