mirror of
https://github.com/DirectoryLister/DirectoryLister.git
synced 2025-08-25 23:06:39 +02:00
Fixed file info modal jank on close
This commit is contained in:
@@ -3,21 +3,19 @@ import axios from 'axios';
|
||||
export default () => ({
|
||||
error: null,
|
||||
filePath: 'file.info',
|
||||
hashes: {
|
||||
md5: '••••••••••••••••••••••••••••••••',
|
||||
sha1: '••••••••••••••••••••••••••••••••••••••••',
|
||||
sha256: '••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••'
|
||||
},
|
||||
loading: false,
|
||||
hashes: null,
|
||||
visible: false,
|
||||
|
||||
get title() {
|
||||
return this.filePath.split('/').pop();
|
||||
},
|
||||
|
||||
get loading() {
|
||||
return this.hashes === null;
|
||||
},
|
||||
|
||||
async show(filePath) {
|
||||
this.filePath = filePath;
|
||||
this.loading = true;
|
||||
this.visible = true;
|
||||
|
||||
try {
|
||||
@@ -28,12 +26,11 @@ export default () => ({
|
||||
}
|
||||
|
||||
this.hashes = response.data.hashes;
|
||||
this.loading = false;
|
||||
},
|
||||
|
||||
hide() {
|
||||
this.visible = false;
|
||||
this.loading = false;
|
||||
this.hashes = null;
|
||||
this.error = null;
|
||||
}
|
||||
});
|
||||
|
@@ -1,8 +1,8 @@
|
||||
<div class="fixed inset-0 flex justify-center items-center bg-gray-800 bg-opacity-50 p-4 z-50 dark:bg-gray-600 dark:bg-opacity-50"
|
||||
x-data="file-info-modal" x-show="visible" @click.self="hide()" @keyup.escape.window="hide()"
|
||||
@show-file-info.window="show($event.detail.file)" x-transition.opacity x-cloak
|
||||
@show-file-info.window="show($event.detail.file)" x-transition:enter.opacity x-cloak
|
||||
>
|
||||
<div x-show="!loading" x-transition @click.away="hide()" class="bg-white rounded-lg shadow-lg overflow-hidden dark:bg-gray-800 dark:text-white">
|
||||
<div x-show="!loading" x-transition:enter @click.away="hide()" class="bg-white rounded-lg shadow-lg overflow-hidden dark:bg-gray-800 dark:text-white">
|
||||
<header class="flex justify-between items-center bg-blue-600 p-4 dark:bg-purple-700">
|
||||
<i class="fas fa-info-circle fa-lg text-white"></i>
|
||||
|
||||
|
Reference in New Issue
Block a user