fix: Issues #228 done.
This commit is contained in:
@@ -353,19 +353,27 @@ export async function renameModal(rename, type, id, baseName) {
|
|||||||
*/
|
*/
|
||||||
export async function deleteFileModal(files, type, id, name) {
|
export async function deleteFileModal(files, type, id, name) {
|
||||||
const filesStore = FilesStore();
|
const filesStore = FilesStore();
|
||||||
|
|
||||||
let htmlText = files.length === 0 ? `Do you really want to delete <span class="text-primary">${name}</span>?` : `<div class="text-left mx-4 space-y-1"><p class="mb-2">Do you really want to delete <span class="text-primary">${name}</span>?</p><p>The following dependent file(s) will also be deleted:</p><ul class="list-disc ml-6">${files}</ul></div>`;
|
let htmlText = files.length === 0 ? `Do you really want to delete <span class="text-primary">${name}</span>?` : `<div class="text-left mx-4 space-y-1"><p class="mb-2">Do you really want to delete <span class="text-primary">${name}</span>?</p><p>The following dependent file(s) will also be deleted:</p><ul class="list-disc ml-6">${files}</ul></div>`;
|
||||||
|
|
||||||
|
const deleteCustomClass = { ...customClass };
|
||||||
|
deleteCustomClass.confirmButton = '!inline-block !rounded-full !text-sm !font-medium !text-center !align-middle !transition-colors !duration-300 !px-5 !py-2 !w-[100px] !h-[40px] !text-danger !bg-neutral-10 !border !border-danger';
|
||||||
|
|
||||||
const result = await Swal.fire({
|
const result = await Swal.fire({
|
||||||
title: 'Confirm Deletion',
|
title: 'CONFIRM DELETION',
|
||||||
html: htmlText,
|
html: htmlText,
|
||||||
icon: 'warning',
|
icon: 'warning',
|
||||||
iconColor: '#FF3366',
|
iconColor: '#FF3366',
|
||||||
reverseButtons:true,
|
reverseButtons:true,
|
||||||
confirmButtonText: 'Yes',
|
confirmButtonColor: '#ffffff',
|
||||||
confirmButtonColor: '#FF3366',
|
|
||||||
showCancelButton: true,
|
showCancelButton: true,
|
||||||
cancelButtonText: 'No',
|
cancelButtonColor: '#FF3366',
|
||||||
cancelButtonColor: '#94a3b8',
|
customClass: deleteCustomClass,
|
||||||
customClass: customClass,
|
didOpen: () => {
|
||||||
|
const confirmButton = Swal.getConfirmButton();
|
||||||
|
|
||||||
|
confirmButton.style.border = '1px solid #FF3366';
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if(result.isConfirmed) {
|
if(result.isConfirmed) {
|
||||||
|
|||||||
Reference in New Issue
Block a user