|
1 | 1 | <template> |
2 | 2 | <Modal :show="visible" v-on:close="onModalClose" :showCloseIcon="false" :dismissable="!isLoading"> |
3 | | - <div class="flex items-end"> |
4 | | - <div class="flex-1"> |
5 | | - <label class="input-label"> |
6 | | - Folder Name |
7 | | - </label> |
8 | | - <input |
9 | | - type="text" class="input" name="folder_name" |
10 | | - ref="folderNameField" |
11 | | - v-model="folderName" |
12 | | - v-validate.disabled="'required'" |
13 | | - v-validate="'alpha_dash'" |
14 | | - data-vv-as="Folder Name" |
15 | | - v-on:keyup.enter="submit" |
16 | | - /> |
17 | | - </div> |
18 | | - <div class="ml-4"> |
19 | | - <button type="submit" |
20 | | - class="btn btn-primary btn-sm" |
21 | | - v-on:click.prevent="submit" |
22 | | - :disabled="errors.any() || isLoading" |
23 | | - > |
24 | | - <span class="spinner white" v-bind:class="{ hidden: !isLoading }"> </span> |
25 | | - <span :class="{ hidden: isLoading }"> |
26 | | - Create |
27 | | - </span> |
28 | | - </button> |
29 | | - </div> |
| 3 | + <div> |
| 4 | + <label class="input-label"> |
| 5 | + Directory Name |
| 6 | + </label> |
| 7 | + <input |
| 8 | + type="text" class="input" name="folder_name" |
| 9 | + ref="folderNameField" |
| 10 | + v-model="folderName" |
| 11 | + v-validate.disabled="'required'" |
| 12 | + v-validate="'alpha_dash'" |
| 13 | + data-vv-as="Folder Name" |
| 14 | + v-on:keyup.enter="submit" |
| 15 | + /> |
| 16 | + <p class="input-help">A new directory with this name will be created in the current directory.</p> |
| 17 | + </div> |
| 18 | + <div class="mt-8 text-right"> |
| 19 | + <button class="btn btn-secondary btn-sm" v-on:click="onModalClose">Cancel</button> |
| 20 | + <button type="submit" |
| 21 | + class="ml-2 btn btn-primary btn-sm" |
| 22 | + v-on:click.prevent="submit" |
| 23 | + :disabled="errors.any() || isLoading" |
| 24 | + > |
| 25 | + <span class="spinner white" v-bind:class="{ hidden: !isLoading }"> </span> |
| 26 | + <span :class="{ hidden: isLoading }"> |
| 27 | + Create Directory |
| 28 | + </span> |
| 29 | + </button> |
30 | 30 | </div> |
31 | 31 | <p class="input-help error"> |
32 | 32 | {{ errors.first('folder_name') }} |
|
85 | 85 | this.isLoading = true; |
86 | 86 | createFolder(this.server.uuid, this.credentials, `${this.fm.currentDirectory}/${this.folderName.replace(/^\//, '')}`) |
87 | 87 | .then(() => { |
88 | | - this.$emit('close'); |
| 88 | + this.$emit('created', this.folderName.replace(/^\//, '')); |
89 | 89 | this.onModalClose(); |
90 | 90 | }) |
91 | 91 | .catch(console.error.bind(this)) |
|
0 commit comments