fix ui
This commit is contained in:
parent
d144274c4c
commit
f6676d7d27
@ -184,7 +184,6 @@ document.querySelectorAll('.play-file').forEach(link => {
|
||||
const fileType = this.getAttribute('data-file-type');
|
||||
const relUrl = this.getAttribute('data-url');
|
||||
const nowPlayingInfo = document.getElementById('nowPlayingInfo');
|
||||
document.getElementById('audioPlayerContainer').style.display = "block"
|
||||
|
||||
// Remove the class from all file items.
|
||||
document.querySelectorAll('.file-item').forEach(item => {
|
||||
@ -192,12 +191,16 @@ document.querySelectorAll('.play-file').forEach(link => {
|
||||
});
|
||||
|
||||
if (fileType === 'music') {
|
||||
// Update currentMusicIndex based on the clicked element.
|
||||
const idx = this.getAttribute('data-index');
|
||||
const audioPlayer = document.getElementById('globalAudio');
|
||||
currentMusicIndex = idx !== null ? parseInt(idx) : -1;
|
||||
const playerButton = document.querySelector('.player-button');
|
||||
|
||||
// Update currentMusicIndex based on the clicked element.
|
||||
currentMusicIndex = idx !== null ? parseInt(idx) : -1;
|
||||
|
||||
// Show the audio player container.
|
||||
document.getElementById('audioPlayerContainer').style.display = "block"
|
||||
|
||||
// Add the class to the clicked file item's parent.
|
||||
this.closest('.file-item').classList.add('currently-playing');
|
||||
|
||||
|
||||
@ -88,7 +88,15 @@ function preloadNextImage() {
|
||||
|
||||
function closeGalleryModal() {
|
||||
document.getElementById('gallery-modal').style.display = 'none';
|
||||
document.body.style.overflow = ''; // Restore scrolling.
|
||||
// remove all images
|
||||
const existingImages = document.querySelectorAll('#gallery-modal img');
|
||||
existingImages.forEach(img => {
|
||||
if (img.parentNode) {
|
||||
img.parentNode.removeChild(img);
|
||||
}
|
||||
});
|
||||
// Restore scrolling.
|
||||
document.body.style.overflow = '';
|
||||
}
|
||||
|
||||
function handleGalleryImageClick(e) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user