forked from rDrama/rDrama
1
0
Fork 0

stop "remove attachment" button from overflowing on mobile

master
Aevann 2023-10-04 20:03:03 +03:00
parent afaa0bcb02
commit 9852520cf1
1 changed files with 2 additions and 1 deletions

View File

@ -552,7 +552,8 @@ if (file_upload) {
if (file_upload.files)
{
const file = file_upload.files[0]
file_upload.previousElementSibling.textContent = file.name.substr(0, 50);
const char_limit = screen_width >= 768 ? 50 : 10;
file_upload.previousElementSibling.textContent = file.name.substr(0, char_limit);
if (file.type.startsWith('image/')) {
const fileReader = new FileReader();
fileReader.readAsDataURL(file_upload.files[0]);