Changeset 35899
- Timestamp:
- 2022-01-07T14:51:11+13:00 (2 years ago)
- Location:
- main/trunk/model-interfaces-dev/atea/korero-maori-asr/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/model-interfaces-dev/atea/korero-maori-asr/src/components/AudioUpload.vue
r35898 r35899 56 56 this.$refs.audioFileInput.click(); 57 57 }, 58 /** 59 * Invoked when a drop event occurs on the file upload panel. 60 * @param {DragEvent} ev The drop event. 61 */ 58 62 onFilesDropped(ev) { 59 63 ev.preventDefault(); … … 72 76 this.files.push(ev.dataTransfer.files); 73 77 } 78 }, 79 /** 80 * Invoked when the user clicks a button to remove a file. 81 * @param {MouseEvent} ev The mouse event. 82 * @param {Number} index The index of the file to remove. 83 */ 84 onFileRemove(ev, index) { 85 ev.cancelBubble = true; 86 this.files.splice(index, 1); 74 87 }, 75 88 onFilesChanged() { … … 171 184 <div class="text-input-sl" style="cursor: pointer;" 172 185 @click="openFilePicker" @drop="onFilesDropped" @dragover="$event.preventDefault()"> 173 <span class="text-placeholder material-icons" v-if="!anyFiles"></span> <!-- attach_file -->186 <span class="text-placeholder material-icons"></span> <!-- attach_file --> 174 187 <span class="text-placeholder" v-if="!anyFiles">{{ translations.get("AudioUpload_SelectFileText") }}</span> 175 <span v-if="anyFiles">{{ getFileNameList }}</span> 188 189 <div class="uploaded-file-listing" v-for="(file, index) in files" :key="file.name"> 190 <span>{{ file.name }}</span> 191 <button type="button" @click="onFileRemove($event, index)" class="btn-pin"> 192 <span class="material-icons mdi-s">close</span> 193 </button> 194 </div> 176 195 </div> 177 196 … … 204 223 </template> 205 224 206 <!-- Add "scoped" attribute to limit CSS to this component only -->207 225 <style scoped lang="scss"> 208 226 .audio-file-picker { … … 220 238 } 221 239 240 .uploaded-file-listing { 241 display: flex; 242 align-items: center; 243 244 padding: 3px; 245 gap: 5px; 246 247 border: 1px solid var(--bg-color); 248 border-radius: 3px; 249 border-left: 4px solid var(--bg-color); 250 background: rgba(var(--bg-color-raw), 0.1); 251 252 margin-right: 0.5em; 253 &:last-child { 254 margin-right: 0; 255 } 256 } 257 222 258 .input-bar { 223 259 display: grid; -
main/trunk/model-interfaces-dev/atea/korero-maori-asr/src/styles/_material.scss
r35731 r35899 131 131 border-radius: 50%; 132 132 padding: 0.3em; 133 } 134 135 .btn-pin { 136 appearance: none; 137 display: flex; 138 align-items: center; 139 justify-content: center; 140 141 margin: 0; 142 padding: 2px; 143 background: none; 144 border: none; 145 border-radius: 50%; 146 147 &:hover { 148 background-color: rgba(30, 30, 30, 0.15); 149 } 133 150 } 134 151
Note:
See TracChangeset
for help on using the changeset viewer.