Update.
This commit is contained in:
@@ -138,7 +138,7 @@ export class FileList extends HTMLElement {
|
||||
|
||||
renderFolder(folder) {
|
||||
const isSelected = this.selectedFolders.has(folder.id);
|
||||
const starIcon = folder.is_starred ? '★' : '☆'; // Filled star or empty star
|
||||
const starIcon = folder.is_starred ? '★' : '☆';
|
||||
const starAction = folder.is_starred ? 'unstar-folder' : 'star-folder';
|
||||
return `
|
||||
<div class="file-item folder-item" data-folder-id="${folder.id}">
|
||||
@@ -149,6 +149,7 @@ export class FileList extends HTMLElement {
|
||||
<button class="action-btn" data-action="delete-folder" data-id="${folder.id}">Delete</button>
|
||||
<button class="action-btn star-btn" data-action="${starAction}" data-id="${folder.id}">${starIcon}</button>
|
||||
</div>
|
||||
<button class="mobile-more-btn" data-folder-id="${folder.id}" aria-label="More actions">⋮</button>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
@@ -157,7 +158,7 @@ export class FileList extends HTMLElement {
|
||||
const isSelected = this.selectedFiles.has(file.id);
|
||||
const icon = this.getFileIcon(file.mime_type);
|
||||
const size = this.formatFileSize(file.size);
|
||||
const starIcon = file.is_starred ? '★' : '☆'; // Filled star or empty star
|
||||
const starIcon = file.is_starred ? '★' : '☆';
|
||||
const starAction = file.is_starred ? 'unstar-file' : 'star-file';
|
||||
|
||||
return `
|
||||
@@ -173,6 +174,7 @@ export class FileList extends HTMLElement {
|
||||
<button class="action-btn" data-action="share" data-id="${file.id}">Share</button>
|
||||
<button class="action-btn star-btn" data-action="${starAction}" data-id="${file.id}">${starIcon}</button>
|
||||
</div>
|
||||
<button class="mobile-more-btn" data-file-id="${file.id}" aria-label="More actions">⋮</button>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
@@ -260,6 +262,26 @@ export class FileList extends HTMLElement {
|
||||
return;
|
||||
}
|
||||
|
||||
if (target.classList.contains('mobile-more-btn')) {
|
||||
e.stopPropagation();
|
||||
const fileId = target.dataset.fileId;
|
||||
const folderId = target.dataset.folderId;
|
||||
const rect = target.getBoundingClientRect();
|
||||
|
||||
if (fileId) {
|
||||
const file = this.files.find(f => f.id === parseInt(fileId));
|
||||
if (file) {
|
||||
this.showFileContextMenu(rect.left, rect.bottom, file);
|
||||
}
|
||||
} else if (folderId) {
|
||||
const folder = this.folders.find(f => f.id === parseInt(folderId));
|
||||
if (folder) {
|
||||
this.showFolderContextMenu(rect.left, rect.bottom, folder);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (target.classList.contains('select-item')) {
|
||||
e.stopPropagation();
|
||||
return;
|
||||
|
||||
@@ -100,6 +100,7 @@ export class MyWebdavApp extends HTMLElement {
|
||||
}
|
||||
|
||||
showLogin() {
|
||||
document.body.classList.remove('logged-in');
|
||||
this.innerHTML = `
|
||||
<div class="login-container">
|
||||
<login-view></login-view>
|
||||
@@ -126,6 +127,7 @@ export class MyWebdavApp extends HTMLElement {
|
||||
}
|
||||
|
||||
render() {
|
||||
document.body.classList.add('logged-in');
|
||||
this.innerHTML = `
|
||||
<div class="app-container">
|
||||
<header class="app-header">
|
||||
|
||||
Reference in New Issue
Block a user