WIP: storage-fix-local-nas work before playlist controls feature
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This commit is contained in:
1 parent
6b3ab5b65e
commit
c160242dbc
46 files changed
+5365
-815
No files matched your search
@@ -318,19 +318,29 @@ const thumbnailDefault = document.getElementById('playlist-thumbnail-default');
|
||||
const thumbnailPreview = document.getElementById('playlist-thumbnail-preview');
|
||||
const thumbnailImg = document.getElementById('playlist-thumbnail-img');
|
||||
|
||||
// Click to upload
|
||||
// Click to upload — open file picker; cropper will open after file is chosen
|
||||
thumbnailDropzone.addEventListener('click', function(e) {
|
||||
if (e.target.closest('button')) return;
|
||||
if (typeof window.openCropperModal_thumb_pl_create === 'function') {
|
||||
window.openCropperModal_thumb_pl_create();
|
||||
} else {
|
||||
thumbnailInput.click();
|
||||
}
|
||||
thumbnailInput.click();
|
||||
});
|
||||
|
||||
// File input change
|
||||
// File input change — if cropper is open (result came from cropper), just show preview;
|
||||
// otherwise preload the file into the cropper and open it.
|
||||
thumbnailInput.addEventListener('change', function() {
|
||||
handleThumbnailSelect(this);
|
||||
if (!this.files || !this.files[0]) return;
|
||||
const cropperOpen = document.getElementById('tcOverlay_thumb_pl_create')?.classList.contains('open');
|
||||
if (cropperOpen) {
|
||||
handleThumbnailSelect(this);
|
||||
return;
|
||||
}
|
||||
const file = this.files[0];
|
||||
if (typeof window.tcPreload_thumb_pl_create === 'function' &&
|
||||
typeof window.openCropperModal_thumb_pl_create === 'function') {
|
||||
window.tcPreload_thumb_pl_create(file);
|
||||
window.openCropperModal_thumb_pl_create();
|
||||
} else {
|
||||
handleThumbnailSelect(this);
|
||||
}
|
||||
});
|
||||
|
||||
// Drag and drop
|
||||
@@ -353,7 +363,8 @@ thumbnailDropzone.addEventListener('drop', function(e) {
|
||||
|
||||
if (e.dataTransfer.files.length) {
|
||||
const droppedFile = e.dataTransfer.files[0];
|
||||
if (typeof window.tcPreload_thumb_pl_create === 'function') {
|
||||
if (typeof window.tcPreload_thumb_pl_create === 'function' &&
|
||||
typeof window.openCropperModal_thumb_pl_create === 'function') {
|
||||
window.tcPreload_thumb_pl_create(droppedFile);
|
||||
window.openCropperModal_thumb_pl_create();
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user