mirror of
https://github.com/DirectoryLister/DirectoryLister.git
synced 2025-08-18 20:02:58 +02:00
Renamed some files and variables to fix some JS errors
This commit is contained in:
@@ -2,11 +2,11 @@ import Alpine from 'alpinejs';
|
||||
import hljs from 'highlight.js';
|
||||
|
||||
// Alpine.js components
|
||||
import Application from './components/application.js';
|
||||
import FileInfoModal from './components/file-info-modal.js';
|
||||
import Application from './components/Application.js';
|
||||
import FileInfoModal from './components/FileInfoModal.js';
|
||||
|
||||
Alpine.data('application', Application);
|
||||
Alpine.data('file-info-modal', FileInfoModal);
|
||||
Alpine.data('fileInfoModal', FileInfoModal);
|
||||
|
||||
// Run Alpine.js
|
||||
Alpine.start();
|
||||
|
@@ -3,7 +3,7 @@ import axios from 'axios';
|
||||
export default () => ({
|
||||
error: null,
|
||||
filePath: 'file.info',
|
||||
hashes: null,
|
||||
hashes: {},
|
||||
visible: false,
|
||||
|
||||
get title() {
|
||||
@@ -11,7 +11,7 @@ export default () => ({
|
||||
},
|
||||
|
||||
get loading() {
|
||||
return this.hashes === null;
|
||||
return Object.keys(this.hashes).length === 0;
|
||||
},
|
||||
|
||||
async show(filePath) {
|
||||
@@ -30,7 +30,7 @@ export default () => ({
|
||||
|
||||
hide() {
|
||||
this.visible = false;
|
||||
this.hashes = null;
|
||||
this.hashes = {};
|
||||
this.error = null;
|
||||
}
|
||||
});
|
@@ -1,5 +1,5 @@
|
||||
<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()"
|
||||
x-data="fileInfoModal" x-show="visible" @click.self="hide()" @keyup.escape.window="hide()"
|
||||
@show-file-info.window="show($event.detail.file)" x-transition:enter.opacity x-cloak
|
||||
>
|
||||
<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">
|
||||
|
Reference in New Issue
Block a user