(bytes)
| 285 | } |
| 286 | |
| 287 | _formatFileSize(bytes) { |
| 288 | if (bytes >= 1e9) { |
| 289 | return (Math.round(bytes / 1e8) / 10) + ' GB'; |
| 290 | } else if (bytes >= 1e6) { |
| 291 | return (Math.round(bytes / 1e5) / 10) + ' MB'; |
| 292 | } else if (bytes > 1000) { |
| 293 | return Math.round(bytes / 1000) + ' KB'; |
| 294 | } else { |
| 295 | return bytes + ' Bytes'; |
| 296 | } |
| 297 | } |
| 298 | |
| 299 | hide() { |
| 300 | this.$el.querySelector('.preview').style.visibility = 'hidden'; |